qtq80-ThOwnE

Integrate Katalon with Azure DevOps

As I am going to write a blog series over Automation using Katalon Studio and Azure DevOps. I’ll cover all the topics including Automation in CICD pipeline, Reporting, Association of Test Cases, and many more in the different blog posts.

In this blog post of the series, we will see how we can integrate Katalon with Azure DevOps with Automation.

INTRODUCTION

Katalon Studio is a powerful automation tool to simplify Web, API, Mobile, Desktop Automated Tests. It can be utilized for integration with popular CI/CD tools such as Azure DevOps, Jenkins, TeamCity, etc.

You need to have Katalon Studio version 7.0.0 or later to use the Azure DevOps extension.

This extension is NOT available for Linux.

PREREQUISITES
  • Must have a Trial or Valid License (Always use your business email for trial Account).
  • Azure DevOps Service Account with the required permission.
  • Installation of Katalon for Azure DevOps extension.
  • Katalon Studio command for console mode execution.
  • The command will invoke Katalon Studio Tests task for execution so a Katalon build is needed for each execution.

So, let’s begin, please follow the below steps.

STEP 1

I am assuming you have signup on the Katalon Portal with your business account and downloaded the latest Katalon Studio.

In my case, I am using a trial license and Katalon Studio 7.3.1 to integrate Katalon with Azure DevOps. You can use a trial license which will provide access to all the features for a limited time period.

STEP 2

Go to this link to install Katalon for Azure DevOps extension. Once you have installed the extension, you will need to configure to execute the Katalon Studio Tests task to complete the integration.

STEP 3

If you already have a repo for the Katalon project on Git or Azure, then go to step 4, otherwise follow the below steps.

In Azure DevOps, I have created a separate Project for demo purposes. Inside that project, I have created a repository by importing a sample Webservice project from Katalon Git Repositories. You can use your own custom Katalon Project.

You can also create an empty repository on Azure and make a clone on your local machine. After that put your katalon project in that folder and commit those changes.

STEP 4

Regarding the Command Arguments, you can generate them from your Katalon Studio.

Click on Build CMD icon in Katalon Studio Tool. Click on the Browse button and select your Test Suit. Now click on the Generate Command button.

Note: Please leave out any irrelevant arguments such as -runmode-apiKeyOnPremises, etc.

STEP 5

Now go to Pipeline in Azure DevOps to add Katalon Task.

  • If you are using Classic Editor to create a pipeline without YAML then you will get a screen like this. Search for Katalon and then click on the Add button.

After adding the task, Now define the version of your Katalon Studio and Command Argument.

You can give your project path as given below by adding the relative path of your .prj file to D:\a\1\s\.

If you are using the Yaml option to create an azure pipeline. Search for Katalon and click on Task.

Now define the version of your Katalon Studio and Command Argument and click on Add button.

STEP 6

 Now Save the pipeline and run it manually.

In the next blog post, I’ll write down about Reporting in Azure DevOps using Katalon.

Untitled-design

How to optimize automation using Azure DevOps

In this blog, we are discussing a feature of DevOps by which we can optimize automation. Manual testing is out fashioned yet it is still important but if we work on big projects we always feel the testing phase should be performed rapidly. Here at moreYeahs we are optimizing automation using DevOps.

We are using selenium to do automation for testing of the dynamics CRM project. Using the .net Unit test project we created test cases. Under the TestClasses, we defined TestMethod which is basically test cases. Test Classes categories type of test. For best practice, we should always have some basic test cases which need to be performed each time we create a new build to do further development.

Before doing all these we need to write test cases that contain test steps. Test Steps describe the execution steps and expected results that are documented against each one of those steps. Each step is marked pass or fail based on the comparison result between the expected and actual outcomes.

Save test case and copy its id.

Now we need to associate this test to our unit project for it we need to place code on the repository. From the test explorer, we need to associate the test as below.

You need to add the ID of the test case created in azure DevOps’s test case.

You got the link of a test case in ID column which directly opens into azure DevOps.

Here we are ready enough to use one of the most useful features of DevOps which provide true automation. Azure Pipelines is a cloud service that you can use to automatically build and test your code project and make it available to other users. It works with just about any language or project type. Azure Pipelines combines continuous integration (CI) and continuous delivery (CD) to constantly and consistently test and build your code and ship it to any target. Azure Pipeline is its self topic which I will cover on the next blog. Here I would like to discuss the pipeline that will automate the test cases.

Before creating a pipeline we need to create a configuration of test plan in Azure DevOps. The configuration is a platform on which the test code will run. Like which OS to use, which browser to use, etc. All these definitions provided in the configuration.

We need to assign a configuration to test suits so suits will use configuration to run its test cases.

Now we are good to use pipeline’s vsTest task add it into a pipeline and configure it below.

Select test plan from the dropdown, select test suits, select test configuration.

check Test mix contains UI test as it is automation we need to check this.

Save and queue the pipeline and run it. you can see real-time logs as tasks are running.

We can get a summary of test cases also we can get logs of fail test cases. All these features going to provide ease in the development process and help develop more effective softwares.