Set up Desired Capabilities for WebUI Testing in Katalon Studio
Katalon Studio allows you to define desired capabilities for local execution with Chrome, Firefox, Internet Explorer (IE), Safari, Edge or Edge (Chromium) in Project Settings.
This article shows you how to configure some common capabilities in WebUI testing and where they are saved.
You can find some common desired capabilities configurations in our GitHub sample project: Tips and tricks.
Chrome/Chrome (headless) desired capabilities
To set Chrome/Chrome (headless) desired capabilities, go to Project > Settings > Desired Capabilities > WebUI > Chrome/Chrome (headless). You can add, delete or clear (delete all) capabilities for Chrome/Chrome (headless) browser.
After clicking Add, provide Name, Type and Value of the property that you wish to configure.
- Desired capabilities is a JSON object (having keys and values pair). We need to set the capability Name as
keyand the capability Value asvalue. - The capabilities keys are case-sensitive.
- If the property requires an
integervalue, be sure to add the value without decimal. E.g.profile.default_content_setting_values.notificationstakes values0,1, and2- assigning1.0would not work.
Alternatively, go to <your test project location>\settings\internal, open the settings files for Chrome/Chrome (headless), and edit the capabilities in the Groovy script.
| Driver | Settings file |
|---|---|
| Chrome | com.kms.katalon.core.webui.chrome.properties |
| Chrome (Headless) | com.kms.katalon.core.webui.chrome (headless).properties |
To see all ChromeDriver supported capabilities, you can refer to the ChromeDriver document here: Capabilities & ChromeOptions.
Common use cases
Below are some common use cases of the desired capabilities for Chrome:
Use case 1: To start Chrome maximized by default. Click Add on the command toolbar, then type in the following value.
| Name | Type | Value |
|---|---|---|
| args | List | --start-maximized |
Alternatively, add the following script into the settings file for Chrome/Chrome (headless) in <your test project location>\settings\internal\.
{
"CHROME_DRIVER": {
"args": [
"--start-maximized"
]
}
}
Use case 2: To start Chrome in incognito (private) mode. Click Add on the command toolbar, then type in the following value.
| Name | Type | Value |
|---|---|---|
| args | List | --incognito |
Alternatively, add the following script into the settings file for Chrome/Chrome (headless) in <your test project location>\settings\internal\.
{
"CHROME_DRIVER": {
"args": [
"--incognito"
]
}
}
Use case 3: Configure Chrome to automatically download files to a specific directory.
| Name | Type | Value |
|---|---|---|
| prefs | Dictionary | Click More (...). In the pop-up Dictionary Property Builder dialog, input values from Table 2. |
| Name | Type | Value |
|---|---|---|
| download.default_directory | String | C:\Downloads |
| download.prompt_for_download | Boolean | false |
| download.directory_upgrade | Boolean | true |
Alternatively, add the following script into the settings file for Chrome/Chrome (headless) in <your test project location>\settings\internal\.
{
"CHROME_DRIVER": {
"prefs": {
"download.default_directory": "C:\\Downloads",
"download.prompt_for_download": false,
"download.directory_upgrade": true
}
}
}
Use case 4: Hide Chrome is being controlled by automated test software message
When running automated web tests using Katalon Studio with Chrome, users may notice the Chrome is being controlled by automated test software message displayed at the top of the browser. It's harmless, but distracting and doesn't look good on client-facing demos.
You can add the following argument in Desired Capabilities > Web UI > Chrome to hide it (the hiding is visual only, Chrome will still be running in automation mode):
| Name | Type | Value |
|---|---|---|
excludeSwitches | List | [enable-automation] |
This prevents ChromeDriver from applying the automation flag that triggers the banner.
Use case 5: Bypass the Local Network Access popup in Chrome
When running tests on Web applications that access local network resources, Chrome may display a Local Network Access permission popup, which can block execution and cause test failures.
Disabling web security should be used only in test environments. It is not recommended for production-like security testing, as it relaxes Chrome’s built-in security restrictions.
You can bypass this popup by adding the following value in Chrome Desired Capabilities:
| Name | Type | Value |
|---|---|---|
| args | List | --disable-web-security |
This argument disables Chrome’s web security checks, allowing access to local network resources without triggering the popup during automated execution.
Alternatively, add the following script into the settings file for Chrome/Chrome (headless) in <your test project location>\settings\internal\.
{
"CHROME_DRIVER": {
"args": [
"--disable-web-security"
]
}
}
Firefox/Firefox (headless) desired capabilities
To get access to some useful capabilities for Firefox, follow these steps:
- Open Firefox browser
- In the address bar, type
about:config - Search for the browser key
To define Firefox desired capabilities in Katalon Studio, follow these steps:
- Go to Project > Settings > Desired Capabilities > WebUI > Firefox/Firefox (headless).
- Click Add to create a key called
moz:firefoxOptions. - Add your capabilities inside the
moz:firefoxOptionskey.
To learn more about the use of the moz:firefoxOptions