Table of contents
1.
Introduction to Katalon
2.
Pass desired capabilities at runtime for WebUI Testing
3.
Override desired capabilities in project settings
4.
Pass desired capabilities at runtime for remote execution
5.
Frequently Asked Questions 
5.1.
What is Katalon Studio?
5.2.
What are Desired Capabilities in Katalon Studio?
5.3.
How can the desired capabilities be overwritten at runtime?
6.
Conclusion
Last Updated: Aug 13, 2025

Pass desired capabilities at runtime in Katalon Studio

Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction to Katalon

Katalon is an automating testing software, that lets the users test web, mobile or desktop applications and APIs without coding, to deliver efficient and robust software to the consumers. The software is built over the Selenium and Appium automation frameworks, and makes testing convenient and code-free. 

Katalon

Pass desired capabilities at runtime for WebUI Testing

Insert the given code before the test script to override the desired capabilities predefined the in the project settings and instead apply the desired capabilities at runtime 
 

import com.kms.katalon.core.configuration.RunConfiguration
RunConfiguration.setWebDriverPreferencesProperty(<key>, <value>)

Example to Open Firefox Browser in Private Mode

The following is a sample demonstration of how to configure the desired capabilities at runtime so as to open a test case on Firefox in private mode.
 

  1. Open the script of the test case
  2. Pass the -private argument to the sample code. Then place the given code before the test script, as directed above, to implement the passing. 

 

import com.kms.katalon.core.configuration.RunConfiguration
Map firefoxOptions =[args:"-private"]
RunConfiguration.setWebDriverPreferencesProperty('moz:firefoxOptions', firefoxOptions)

 

  1. Complete writing the script or autocomplete it using Web Spy/Record Utility.
step1

2. Finally, run the test with firefox. 

step2

 

NOTE: make sure the browser is updated. Go to Tools > Update WebDrivers > Choose browser to update the browser.

 

The test run is successful, and a private webpage opens on Firefox. 

sample webpage that opens up

 

Override desired capabilities in project settings

Pre-configured desired capabilities in the project settings can be overwritten by using the above sample code in the test script. 
 

For instance, in the example above, we defined the window size as 1200x600 in the desired capabilities in the project settings. To override this setting to open a chrome window sized 100x100, follow the subsequent steps: 
 

  1. Open the test case in script mode. Now pass the desired capabilities to the same key with the capabilities defined in project settings. Place this code before the test script as usual to override the desired capabilities at runtime.
     

As we can see here , replace --window-size=1200,600 with --window-size=100,100. So we pass the two required capabilities as arguments, --window-size=100,100 and --incognito, to the args keys in the sample code. This sample code is placed before the test. 
 

import com.kms.katalon.core.configuration.RunConfiguration
RunConfiguration.setWebDriverPreferencesProperty("args", ["--window-size=100,100","--incognito"])

 

2. Complete writing the script or autocomplete it using Web Spy/Record Utility.

step2

 

3.  Now run the test with chrome. 

step3

We can see that an incognito window opens up in a 100x100 format.
 

Pass desired capabilities at runtime for remote execution

Here is another example wherein we will set up a remote execution environment as Windows 10. To do so, enter the following code before the test script:
 

import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import com.kms.katalon.core.configuration.RunConfiguration


RunConfiguration.setDriverPreferencesProperty('Remote', 'os', 'Windows')  
RunConfiguration.setDriverPreferencesProperty('Remote', 'os_version', '10')  


WebUI.openBrowser('google.com')

Frequently Asked Questions 

What is Katalon Studio?

Katalon is an automating testing software, that lets the users test web, mobile or desktop applications and APIs without coding, to deliver efficient and robust softwares to the consumers.
 

What are Desired Capabilities in Katalon Studio?

Desired capabilities are key-value pairs that help the user specify browser properties such as browser name, version, path of the driver etc. These desired capabilities can be defined in the Project > Settings > Desired Capabilities.
 

How can the desired capabilities be overwritten at runtime?

The pre-configured desired capabilities can be overwritten at runtime by explicitly defining the capabilities in code and adding the code snippet over the test script. 

 

Conclusion

In this blog, we successfully learnt how to pass desired capabilities at runtime and overwrite the pre-configured capabilities in the project settings. We saw some examples demonstrating this feature's use and how the output changed with the custom arguments. Share this article with your fellow ninjas if you found it helpful. Along with this, visit our platform Coding Ninjas Studio to read informational articles on important computer fundamentals like DBMSDSACompetitive ProgrammingPythonJava, etc. Happy Coding!!

 

Live masterclass