DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Selenium vs Cypress: Does Cypress Replace Selenium?
  • Testing Java and Spring Applications With Kotlin: Low-Risk to Adoption
  • Does 100% Code Coverage Mean Tested?
  • How We Know What We Know

Trending

  • OpenCode: Setting Up an Open-Source AI Coding Assistant
  • To Switch, or Not to Switch the AI Model
  • How You Clear Your HTML5 Canvas Matters
  • How to Keep AI Agents From Going Rogue Using Docker Sandbox

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Testing, Tools, and Frameworks
  4. Executing Automated Tests in Console Mode in Katalon Studio

Executing Automated Tests in Console Mode in Katalon Studio

Learn how to execute automated test cases in the Katalon Studio testing framework in console mode, using the command prompt.

By 
Oliver Howard
·
Oct. 06, 17 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
14.9K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

One of the advantages of Katalon Studio is that you can execute automation tests without launching Katalon Studio IDE by using command line mode execution. Users use this function to run execution batch files or planning jobs in CI tools. This easy-to-follow guide will walk you through the steps of how to execute test cases using the command prompt.

Execute Katalon in CMD

1. Open the command prompt and navigate to the Katalon Studio folder that contains the katalon.exe file. For example:

open Katalon.exe

2. Enter the following syntax to execute automation tests:

katalon {option1} {option2} ... {optionN}

This command includes:

Item Description
katalon The command of Katalon Studio to execute automation test.
{option(s)} The additional options for the execution (see the description below for details).

For example:

C:

cd C:\Katalon\4.7

katalon -runMode=console -projectPath="C:\Project\Sample Project.prj" -reportFolder="Reports" -reportFileName="report" -retry=0 -testSuitePath="Test Suites/TS_RegressionTest" -browserType="Chrome"

3. Press Enter to start execution.

Katalon Command Line Options

Here’s the list of options supported in the “katalon” command:

Katalon Command Line Option Description Required?
-runMode=console Enable the console mode. Yes
-projectPath=<path> Specify the project folder that includes the.prj file. The absolute path must be used in this case. Yes
-testSuitePath=<path> Specify the test suite file (without extension.ts). The relative path (relative to the project folder) must be used in this case. Yes
-testSuiteCollectionPath=<path> Specify the test suite file (without extension.tsc). The relative path (relative to the project folder) must be used in this case.

Note: Available only from version 4.4 and later

Yes (If -testSuitePath is not used. Otherwise it’s optional)
-browserType=<browser> Specify the browser type used for test suite execution.

The following browsers are supported in Katalon:

  • Firefox
  • Chrome
  • IE
  • Safari
  • Remote
  • Android
  • iOS
Yes
-remoteWebDriverType=<Selenium, Appium> Remote web’s driver type (Selenium or Appium) Yes (If -remoteWebDriverUrl is used)
-deviceId=<device Id for Android/device uuid for ios> Specify the device’s ID to execute test scripts Y (If -browserType=Android or -browserType=iOS is used)
-consoleLog Display log in the console. No
-noExit Keep the console open after the execution is completed. No
-summaryReport Send summary report of a batch run. No
-statusDelay=<seconds> System will update the test case’s execution status after the specified seconds. No
-retry=<number of retry times> Number of times running test cases in the test suite. No
-retryFailedTestCases=<true, false> Retry failed test cases (overriding the setting in the test suite file). Set true if you want to rerun failed test cases and false otherwise. No
-qTestDestId=<destination’s id> Id of the destination where the result will be uploaded to No
-qTestDestType=<destination’s type> Type of the destination. There are 4 types, including “test-suite”, “test-cycle”, “release”, and “root”. No
-reportFolder=<path> Specify the destination folder to store report files. Can use an absolute path or relative path (relative to the project folder). No
-reportFileName=<name> Specify the name of report files (.html, .csv, .log). If not provided, the system uses the name “report” (report.html, report.csv, report.log). This option only takes effect when being used with “-reportFolder” option. No
-remoteWebDriverUrl=<remote web server url> Specify the remote web driver’s URL No
-email The email used to register Katalon Studio No (If Katalon Studio is already activated)
-password The corresponding password for the registered email above. No (If Katalon Studio is already activated)

Command Builder

Instead of typing directly in the command prompt, you can quickly generate commands to execute test suites by following the steps below:

1. Click on Build CMD from the main toolbar.
Build CMD Katalon Studio

2. The Generate Command for Console Mode dialog is displayed as below. Configure your options as needed.

Generate Command for Console Mode
This dialog has the following options:

Section Description
Test Suite The Test Suite or Test Suite Collection to be executed
Executed Platform

The platform used to execute the test:

Executed Platform Katalon Studio

Remote Web Driver URL is enabled if you choose to run with a Remote option.

Mobile Device is enabled if you choose to run with Android or iOS.

Custom Execution is enabled if you choose to run with Custom option.

Report Configuration

Extra settings for report after the execution is completed:

Extra settings for report

Output Location: the local folder to export the report.

Use relative path to current project: display the relative path to the output location, starting from the current project location.

Report File Name: the name for your generated report.

Send Summary Report to recipients below: enable sending the summary report to recipients who emails are specified Mail Recipients.

Other Options Other Report Options

3. Click on Generate Command after you complete the configuration. The command is generated and shown in a dialog, as below:
Generate Command Katalon Studio

4. You can Copy to Clipboard and paste it into the command prompt for execution.

Use Console.properties File

Instead of specifying command settings for each execution, you can place all settings in the console.properties and use this file in the command prompt. This file can be generated using the same Command Builder as above.

1. Generate console.properties file using Command Builder

Command Builder Katalon Studio
2. The console.properties file will be generated to your preferred location. You can open and update the parameters manually as needed.For example:
open and update the parameters manually

3. Run the console.properties file in the console mode using the following syntax:
katalon -propertiesFile="<absolute path to console.properties file>" -runMode=console

For example:

  • katalon -propertiesFile="D:\Katalon\Demo_Project\console.properties" -runMode=console

4. You can add extra Katalon command options to this command. Any option already defined in the console.properties file will be overwritten by the one declared on the command line.katalon -propertiesFile="<absolute path to console.properties file" -runMode=console -browserType=IE
This command runs the test on IE instead of Chrome as browserType is set to IE.

For more tutorials about Katalon Studio, please visit the Resources Center!

Testing Katalon Studio Console (video game CLI) Command (computing) Test suite Execution (computing)

Published at DZone with permission of Oliver Howard. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Selenium vs Cypress: Does Cypress Replace Selenium?
  • Testing Java and Spring Applications With Kotlin: Low-Risk to Adoption
  • Does 100% Code Coverage Mean Tested?
  • How We Know What We Know

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook