Skip to main content

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.

info

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 NameType and Value of the property that you wish to configure.

note
  • Desired capabilities is a JSON object (having keys and values pair). We need to set the capability Name as key and the capability Value as value.
  • The capabilities keys are case-sensitive.
Set DC in Chrome

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.

DriverSettings file
Chromecom.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.

NameTypeValue
argsList--start-maximized
KS project settings web ui screen

Alternatively, add the following script into the settings files.

{
"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.

NameTypeValue
argsList--incognito
KS project settings web ui screen

Alternatively, you can copy and paste the following script into the settings files.

{
"CHROME_DRIVER": {
"args": [
"--incognito"
]
}
}

Use case 3: Configure Chrome to automatically download files to a specific directory.

NameTypeValue
prefsDictionaryClick More (...). In the pop-up Dictionary Property Builder dialog, input values from Table 2.
NameTypeValue
download.default_directoryStringC:\Downloads
download.prompt_for_downloadBooleanfalse
download.directory_upgradeBooleantrue

Alternatively, you can copy and paste the following script into the settings files.

{
"CHROME_DRIVER": {
"prefs": {
"download.default_directory": "C:\\Downloads",
"download.prompt_for_download": false,
"download.directory_upgrade": true
}
}
}

Firefox/Firefox (headless) desired capabilities

To get access to some useful capabilities for Firefox, follow these steps:

  1. Open Firefox browser
  2. In the address bar, type about:config
  3. Search for the browser key
Firefox capabilities

To define Firefox desired capabilities in Katalon Studio, follow these steps:

  1. Go to Project > Settings > Desired Capabilities > WebUI > Firefox/Firefox (headless).
  2. Click Add to create a key called moz:firefoxOptions.
  3. Add your capabilities inside the moz:firefoxOptions key.
Create DC for FireFox

To learn more about the use of the moz:firefoxOptions key, you can refer to the Mozilla developer document here: firefoxOptions.

Alternatively, go to <your test project location>\settings\internal , open the settings files for Firefox/Firefox (headless), and edit the capabilities in Groovy.

DriverSettings file
Firefoxcom.kms.katalon.core.webui.firefox.properties
Firefox (Headless)com.kms.katalon.core.webui.firefox (headless).properties

Common use cases

Belows are some common use cases of the desired capabilities for Firefox:

Use case 1: Start Firefox with devtools in private mode. To do so, click Add on the command toolbar, then input the following values:

NameTypeValue
moz:firefoxOptionsDictionaryClick More (...). In the pop-up Dictionary Property Builder dialog, input values from Table 2.
NameTypeValue
argsList--devtools,--private
Open Firefox with Devtools in private mode

Alternatively, add the following script in the settings files.

{
"FIREFOX_DRIVER": {
"moz:firefoxOptions": {
"args": [
"--private",
"--devtools"
]
}
}
}

Use case 2: Start Firefox at a default page. To do so, click Add on the command toolbar, then input the following values:

NameTypeValue
moz:firefoxOptionsDictionaryClick More (...). In the pop-up Dictionary Property Builder dialog, input values from Table 2.
NameTypeValue
prefsDictionaryClick More (...). In the pop-up Dictionary Property Builder dialog, input values from Table 3.
NameTypeValue
browser.startup.homepageStringwww.google.com

Alternatively, you can copy and paste the following script in the settings files.

{
"FIREFOX_DRIVER": {
"moz:firefoxOptions": {
"prefs": {
"browser.startup.homepage": "https://www.google.com/"
}
}
}
}
Start Firefox with default startup page

Use case 3: Download files to specified folders. Here, we want to download .html files to the C:\Downloads folder. To do so, click Add in the command toolbar, input the following values:

NameTypeValue
moz:firefoxOptionsDictionaryClick More (...). In the pop-up Dictionary Property Builder dialog, input values from Table 2.
NameTypeValue
prefsDictionaryClick More (...). In the pop-up Dictionary Property Builder dialog, input values from Table 3.
NameTypeValue
browser.download.folderListNumber2.0
browser.helperApps.alwaysAsk.forceBooleanFalse
browser.download.manager.showWhenStartingBooleanFalse
browser.download.dirStringC:\Downloads
browser.download.dirStringC:\Downloads
browser.download.defaultFolderStringC:\Downloads
browser.helperApps.neverAsk.saveToDiskStringtext/html

Explanation of the settings:

  • browser.download.folderList: Setting this preference as 2 tells Firefox to use the directory specified in browser.download.dir as the download folder instead. You can learn more about this preference in the MozillaZine document here: About:config entries.
  • browser.download.manager.showWhenStarting: Setting this preference as False turns off the showing of download progress.
  • browser.download.dir: This preference is to set path for the downloading folder, for example, C:\Downloads.
  • browser.helperApps.neverAsk.saveToDisk: This preference tells Firefox to automatically download the files of the selected MIME types. The list of MIME types is comma-separated. To find the MIME types of the files you want to download, you can refer to the Mozilla developer document here: Check MIME types.

Alternatively, you can copy and paste the following script in the settings files.

{
"FIREFOX_DRIVER": {
"moz:firefoxOptions": {
"prefs": {
"browser.download.folderList": 2.0,
"browser.helperApps.alwaysAsk.force": false,
"browser.download.manager.showWhenStarting": false,
"browser.download.dir": "C:\\Downloads",
"browser.download.downloadDir": "C:\\Downloads",
"browser.download.defaultFolder": "C:\\Downloads",
"browser.helperApps.neverAsk.saveToDisk": "text/html"
}
}
}
}
Download HTML file automatically to a folder

Internet Explorer (IE) desired capabilities

The Internet Explorer (IE) driver supports some essential capabilities which can be used for smooth test execution. These capabilities ease the way for automation testing using Selenium WebDriver on Internet Explorer. You can learn more about supported IE capabilities here: IE Specific.


To set desired capabilities for IE, go to Project > Settings > Desired Capabilities > WebUI > IE.

Alternatively, go to <your test project location>\settings\internal , open the settings files for Internet Explorer, and edit the capabilities in Groovy.

DriverSettings file
Internet Explorercom.kms.katalon.core.webui.ie.properties

Common use cases

The most common use of Internet Explorer desired capabilities is to configure Internet Explorer for automation testing. To do so, click Add on the common toolbar, input the following values:

note

If you want to configure Internet Explorer globally, you can refer to this document: Internet Explorer Configurations.

NameTypeValue
ignoreProtectedModeSettingsBooleanTrue
ignoreZoomSettingBooleanTrue
enablePersistentHoverBooleanfalse
requireWindowFocusBooleanfalse
Set DC for IE

You can copy and paste the following script in the settings files.

{
"IE_DRIVER": "ignoreProtectedModeSettings\t",
"ignoreZoomSetting": true,
"enablePersistentHover": false,
"requireWindowFocus": false
}

Explanation of the settings:

  • ignoreProtectedModeSettings: This capability determines whether to skip the protected mode check. Enable this capability for smooth test execution with IE.
  • ignoreZoomSetting: This capability indicates whether to skip checking that the browser's zoom level is set to 100%. Value is set to false by default.
  • enablePersistentHover: This capability determines whether persistent hovering is enabled (true by default). Persistent hovering is achieved by continuously firing the mouse over events at the last location where the mouse cursor has been moved to.
  • requireWindowFocus: This capability determines whether to require the IE window to focus before performing any user interaction operations (mouse or keyboard events). This capability is false by default.

Edge Chromium desired capabilities

To set Edge Chromium desired capabilities, go to Project Settings > Desired Capabilities > WebUI > Edge Chromium.

Common use cases

Below are some common use cases of the desired capabilities for Edge Chromium:

Use case 1: Set Edge Chromium window size. To do so, click Add on the command toolbar, then input the following values:

NameTypeValue
ms:edgeOptionsDictionaryClick More (...). In the pop-up Dictionary Property Builder dialog, input values from Table 2.
ms:edgeChromiumBooleantrue
NameTypeValue
argsListClick More (...). In the pop-up List Property Builder dialog, input values from Table 3.
TypeValue
Stringwindow-size=100,100

Use case 2: Set high-dpi-support and force-device-scale-factor desired capabilities. Click Add on the command toolbar, then input the following values:

NameTypeValue
ms:edgeOptionsDictionaryClick More (...). In the pop-up Dictionary Property Builder dialog, input values from Table 2.
ms:edgeChromiumBooleantrue
NameTypeValue
argsListClick More (...). In the pop-up List Property Builder dialog, input values from Table 3.
TypeValue
String--start-maximized
Stringforce-device-scale-factor=0.75
Stringhigh-dpi-support=0.75

Location of desired capabilities files

You can find the settings files for each environment in the <your test project location>\settings\internal folder.

Settings files for desired caps

The files for each driver are named as follows:

DriverSettings file
Chromecom.kms.katalon.core.webui.chrome.properties
Firefoxcom.kms.katalon.core.webui.firefox.properties
Chrome (Headless)com.kms.katalon.core.webui.chrome (headless).properties
Firefox (Headless)com.kms.katalon.core.webui.firefox (headless).properties
IEcom.kms.katalon.core.webui.ie.properties
Safaricom.kms.katalon.core.webui.safari.properties
Edgecom.kms.katalon.core.webui.edge.properties
Edge (Chromium)com.kms.katalon.core.webui.edge chromium.properties
Was this page helpful?