Automation Tests
To create autamation tests is necessary the Katalon Studio tool. The tests need to be performed in PC and Chrome or Firefox driver is required
Installation
- Register
- Donwload
- Unzip file
- Open executable file.(katalon.exe)
Create Project
- Select “File>New>Project


Create new test
- Start recording

- Insert URL e click Record

- Perform test
- Save Script

Execute Test
To execute a test is required a installed browser (Chrome or Firefox)

Testing on server
To run the tests on the server you will need to place the project folder on the server.
The project has the following structure:
- Data Files (Where test parameters are defined).
- Object Repository (Where are the objects that the test recorder writes).
- Profiles (User profiles are used to change setting according to user).
- Reports (Katalon Studio automatically generates logs with information about the tests).
- Note: Tos not load the server with unnecessary logs, you can add the following command to the script that runs the tests:
- rm -rf [path]/SistemaTestes/Reports/202*
- Note: Tos not load the server with unnecessary logs, you can add the following command to the script that runs the tests:
- Script (Where test scripts are stored).
- Test Cases.
- Test Suites (Test set).
Command Line
To execute tests on server is necessary to run the following command: ./katalon {options}
Example:
./katalon -noSplash -runMode=console -projectPath=[project path] -retry=1 -retryStrategy=immediately -testSuitePath=”Test Suites/[test name]” -browserType=”Chrome (headless)” -executionProfile=”default” -apiKey=”********-****-****-****-************” –config -proxy.auth.option=NO_PROXY -proxy.system.option=NO_PROXY -proxy.system.applyToDesiredCapabilities=true
- -runMode=console
- Run on command line
- -projectPath
- Path to the project
- -retry=1
- Tests tries after fail
- -retryStrategy:
- In case of a test fail, indicates what is the strategy
- Immediately:
- After test fail execute immediately same test.
- allExecutions:
- Execute all tests.
- failedExecutions:
- Execute all tests, then execute failed ones
- Immediately:
- testSuitePath:
- Path to the test suite
- browserType:
- Browser where test will be executed
- executionProfile
- Execution profile
- In case of a test fail, indicates what is the strategy
You can find other command options in: https://docs.katalon.com/docs/katalon-runtime-engine/command-syntax-command-lineconsole-mode-execution
Sugestion
To simplify the execution of the katalon command we suggest to create a executable file containing the command.
vi [script name].sh
// Add katalon command
./katalon {options}
// To delete generated logs
rm -rf [path]/SistemaTestes/Reports/202*
And compile: chmod +x [script name].sh
To execute:
./[script name].sh
Important Considerations
As Katalon in server is in version 6 it’s important to have in mind some changes.
- Change window size to 929×879
- Create file “com.kms.katalon.core.webui.chrome (headless).properties” in folder “[Project Path]/settings/internal/”
- Insert “{“HEADLESS_DRIVER”:{“args”:[“-window-size\u003d929,879″]}}”
- Do to browser headless execution being faster sometimes elements are not visible at execution time, so the sugestion is to add the following command:
- WebUI.delay(1)
- Do not forget to change fields with data to the current data, use the function to get current date.
- In case the command WebUI.setText(…) doens’t work, a set of alternative commands can be used:
- WebUI.sendKeys(findTestObject(…), Keys.chord(Keys.CONTROL,’a’))
- WebUI.sendKeys(findTestObject(…), Keys.chord(Keys.DELETE))
- WebUI.sendKeys(findTestObject(…), texto)