Launchers / Automated tests

Katalon Launcher v2 (Katalon_v2.jar)

The Katalon v2 launcher allows executing and scanning Katalon's test suites
It has been tested with Katalon_Studio_Windows_64-5.4.1

Configuration

The Katalon.xml file is a template and must NOT be edited. It's used by the system to dynamically build the form the user will be able to fill in from the XStudio GUI when creating an execution configuration.

Parameter Description
General
Test root path This must indicate where are located all the katalon test suites.
This is a root path. Each test in XStudio has a canonical path that will be appended to this path.
This path MUST not include an ending slash.

Default value is: C:\Users\public\Katalon Studio
Project relative path This must indicate where is located the global katalon project file.
This is a path related to the Test root path.
This path MUST not include a starting or ending slash.

Default value is: my_projects/my_main_project.prj
Windows command This must indicate which command interpreter to use.

Default value is: C:\WINDOWS\SysWoW64\cmd.exe
Katalon
Katalon engine path This must indicate where is located the specific Katalon execution engine (named katalon) for command line execution.

Default value is: C:\Users\pacca\Documents\katalon\Katalon_Studio_Windows_64-5.4.1\
Properties File This can indicate a katalon specific file that contains the needed data for command line execution.
Katalon can create this files for you using the GUI. In case you don't have it the parameters will be created on the spot by XStudio , provided you fill in the other configuration data below

There's bo default value.
Execution profile Katalon supports various execution profile. Please refer to katalon's documentation for how to use it.
If you set one make sure it does exist in Katalon
Also remmber that if you set a value for the profile, it will overide the one defined the provided in a Properties File (see above)
Default value is: Default
Browser Type Katalon supports various browser to execute the test.You need to set one.
Default value is: Chrome (Headless) In which case you will not see the browser being displayed when executing the test. But it requires you get Chrome installed on you PC.
Number of retries" Katalon allows to relaunch test a certain number of times
Default value is: 0
Only Retry failed Test Cases" Katalon allows to relaunch test for all test or only for failed tests
Default value is: true

These values can be changed while creating the campaign session from XStudio.
Note about file path parameters:
Any parameter referring to a file or folder path (for instance Test root path) can be provided either using \ separator (if the tests are going to be executed on a Windows agent) or / separator (if the tests are going to be executed on a linux or MacOSX agent).

On windows, if you provide a path containing an OS-localizable folder such as C:\Program Files, always prefer the English version (i.e. NOT C:\Programmes if you're using a french-localized Windows) or the corresponding native environment variable (i.e. %PROGRAMFILES%).


Process

  • Each test in XStudio must have his dedicated '.ts' katalon file. The name of the test suite ('.ts') MUST be equal to the name of the XStudio test.
  • In XStudio, each test in XStudio must have a Canonical path field value similar to "Tests path/Test Suites" or "Tests path"
  • The interpreter is executed by the launcher using this syntax:
    katalon -noSplash -runMode=console -summaryReport
    -projectPath="<testRootPath>/<projectRelativePath>"
    -testSuitePath="<testPath>/<testName>" -executionProfile="default"
    -browserType="Chrome (headless)"
    -retry=0 -retryFailedTestCases=true -reportFolder=xstudio_output -reportFileName=XStudio"

    Where:
    • <testRootPath> is provided in the configuration file
    • <projectRelativePath> is provided in the configuration file
    • <testPath> is the path of the test related to the <testRootPath>
    • <testName> is the name of the test (without its '.ts' extension) and must be the same as the '.ts' test suite file name
    • 'xstudio_output' is folder that is created by XStudio for you and that will contain the temporary report files created by Katalon
    • 'XStudio' is the prefix for the HTML and CSV report files created by Katalon

  • If a test has a specific attribute named <com.xqual.katalon.projectRelativePath>, the value of the attribute is used as <projectRelativePath> rather than the configuration's parameter.
  • It can additionally take some parameters (defined as XStudio Parameters), in which case these parameters will be added adder option is added to the above execution line:
    -testSetParam1=param1Value , -testSetParam1=param1Value , ..."
  • Katalon generates multiple report files with formats HTML, CSV, JSON and Junit, + the properties file used at execution time + the execution log.

    XStudio adds a summary log with all the details of the execution with the name <testName>.log
    All will be attached to the XStudio's test case results.
    The junit file is parsed by the launcher and all the summary information will be passed/stored automatically in the XStudio database.

  • Note that an XStudio Test corresponds to a Katalon Test Suite which embeds multiple Katalon Test Cases
    There's no mapping between XStudio's Test Case and Katalon's Test Case.


Permissions

WARNING: if you're running your tests on Windows, it may be required to run the tests as administrator.
Having an account with Administrators permissions may even not be enough in some cases (especially if you're using Windows 10) and you may need to disable completely the UAC (User Access Control) on your computer.
To do so:
  • Press the Windows + R key combination
  • Type in regedit
  • Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
  • In the right-side pane, look for EnableLUA and set the value 0
  • Close the registry editor
  • Restart your computer

Debug

If your tests are not executed correctly or are reporting only failures, this is very likely because your configuration is incorrect or because you used a wrong naming convention for your tests and test cases.

The best way to quickly find out what's wrong is to look at the traces generated by XStudio (or XAgent).
The traces always include the detailed description of what the launcher performs (command line execution, script execution, API calling etc.) to run a test case. So, if you experiment some problems, the first thing to do is to activate the traces and look at what's happening when you run your tests.

Then, try to execute manually in a cmd box the exact same commands.
This will normally fail the same way.
At this point, you needs to figure out what has to be changed in these commands in order to have them run properly.

When you have something working, compare these commands to what's described in the Process chapter above. This will tell you exactly what you need to change.

Most of the time, this is related to:
  • some incorrect values in some parameters of your configuration,
  • the name of your tests,
  • the name of your test cases,
  • the canonical path of your tests