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 > Desired Capabilities > WebUI > Chrome/Firefox/IE/Safari/Edge/Edge(Chromium).

This article shows you how to configure some common capabilities in WebUI testing and where they are saved.

Note:
  • You can find some common desired capabilities configurations in our GitHub sample project: Tips and tricks.

Chrome/Chrome (headless)

Set Chrome/Chrome (headless) desired capabilities in Katalon Studio

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.

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, you can also 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 in Katalon Studio:

  1. To start Chrome maximized by default. Click Add on the command toolbar, then type in the following value:
    NameTypeValue
    argsList--start-maximized
    Alternatively, you can copy and paste the following script into the settings files.
    {"CHROME_DRIVER":{"args":["--start-maximized"]}}

    Maximized in Chrome

  2. To start Chrome in incognito (private) mode. Click Add on the command toolbar, then type in the following value:
    NameTypeValue
    argsList--incognito
    Alternatively, you can copy and paste the following script into the settings files.
    {"CHROME_DRIVER":{"args":["--incognito"]}}
    Open Chrome in incognito

  3. You can also combine many desired capabilities for starting a browser as follows:

    NameTypeValue
    argsList--start-maximized,--incognito

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

    {"CHROME_DRIVER":{"args":["--start-maximized","--incognito"]}}

    Open Chrome maximized in incognito

Note:

Firefox/Firefox (headless)

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

Set Firefox/Firefox (headless) desired capabilities in Katalon Studio

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, you can also 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 in Katalon Studio:

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

    Table 1
    NameTypeValue
    moz:firefoxOptionsDictionaryClick More (...). In the pop-up Dictionary Property Builder dialog, click Add, then input values from Table 2.
    Table 2
    NameTypeValue
    argsList--devtools,--private

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

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

    Open Firefox with Devtools in private mode

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

    Table 1
    NameTypeValue
    moz:firefoxOptionsDictionaryClick More (...). In the pop-up Dictionary Property Builder dialog, click Add, then input values from Table 2.
    Table 2
    NameTypeValue
    prefsDictionaryClick More (...). In the pop-up Dictionary Property Builder dialog, click Add, then input values from Table 3.
    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

  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:

    Table 1
    NameTypeValue
    moz:firefoxOptionsDictionaryClick More (...). In the pop-up Dictionary Property Builder dialog, click Add, then input values from Table 2.
    Table 2
    NameTypeValue
    prefsDictionaryClick More (...). In the pop-up Dictionary Property Builder dialog, click Add, then input values from Table 3.
    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:

    SettingsDescription
    browser.download.folderListSetting 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.showWhenStartingSetting this preference as False turns off the showing of download progress.
    browser.download.dirThis preference is to set path for the downloading folder, for example, C:\Downloads.
    browser.helperApps.neverAsk.saveToDiskThis 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

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.

Set desired capabilities for IE in Katalon Studio

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

Alternatively, you can also 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:

NameTypeValue
ignoreProtectedModeSettingsBooleanTrue
ignoreZoomSettingBooleanTrue
enablePersistentHoverBooleanfalse
requireWindowFocusBooleanfalse

Set DC for IE

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

{"IE_DRIVER":"ignoreProtectedModeSettings\t":true,"ignoreZoomSetting":true,"enablePersistentHover":false,"requireWindowFocus":false}}
Explanation of the settings:
SettingsDescription
ignoreProtectedModeSettingsThis capability determines whether to skip the protected mode check. Enable this capability for smooth test execution with IE.
ignoreZoomSettingThis capability indicates whether to skip checking that the browser's zoom level is set to 100%. Value is set to false by default.
enablePersistentHoverThis 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.
requireWindowFocusThis 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.

Location of desired capabilities files

You can find the settings files for each environment in the <your test project location>\settings\internal folder. The files for each driver are named as follows:

Driver Settings' file
Chrome com.kms.katalon.core.webui.chrome.properties
Firefox com.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
IE com.kms.katalon.core.webui.ie.properties
Safari com.kms.katalon.core.webui.safari.properties
Edge com.kms.katalon.core.webui.edge.properties
Edge (Chromium) com.kms.katalon.core.webui.edge chromium.properties