Katalon Studio supports console mode execution. Additionally, we can utilize it for integration with popular CI tools such as Jenkins and TeamCity. Subsequently, this tutorial shows you the necessary steps to set up integration with a Jenkins server for scheduling Katalon’s execution. We will cover the below topics in this article, Integration with Jenkins and other CI tools:-
- Configuration Steps
- Exit Codes
- Publish JUnit Reports
Here are the requirements to be prepared for Jenkins integration:
- Firstly, you must have already installed Jenkins for Windows (click https://jenkins.io/doc/book/installing/ for a guide) and the browser you’d like to use for the test.
- Secondly, the CI tool is installed and configured correctly. In this example, we will use Jenkins. It is a popular and easy-to-integrate CI tool.
- Additionally, the command will invoke Katalon Studio for execution. Therefore, the requirement of a Katalon build exists for each execution machine.
1. Firstly, go to Manage Jenkins > Manage Plugins > Available tab and find Katalon plugin on the list. After that, select and click Install.
2. Secondly, create a job by selecting New Item in Jenkins
3. Thirdly, tell Jenkins your workspace or simply use git. After that, enter the job name (e.g., “Katalon Studio Tests”), and then choose “Freestyle Project.” There is a sample Katalon Studio project on Github (https://github.com/katalon-studio-samples/ci-samples) for a quick test.
4. Next, tell Jenkins your workspace or simply use git. There is a sample Katalon Studio project on Github (https://github.com/katalon-studio-samples/ci-samples) for a quick test.
5. Fifthly, add and configure the build step, Execute Katalon Studio tests.
When you execute the Katalon Studio command from CI, an exit code will generate as the output. Moreover, you can use this exit code to know whether your execution is successful, passed, or failed.
Below is the list of exit codes:
- 0: the execution passed with no failed or erroneous test case.
- 1: the execution has failed test cases.
- 2: the execution has erroneous test cases.
- 3: the execution has failed test cases and erroneous test cases.
- 4: the execution cannot start because of invalid arguments.
Additionally, to check the test execution report in Katalon, please refer to this guide.
Publish JUnit reports
Starting from Katalon Studio version 7.0, Katalon Studio automatically generates test results of a test suite in the JUnit format with the JUnit_Report.xml file name.
*Note: For the users of Katalon Studio Enterprise, test suite collections’ reports are available in the JUnit format.
Basic Report plugin is available from Katalon Studio version 6.1.5 and later versions. Therefore, test results in JUnit format can automatically export with the file name JUnit_Report.xml