Skip to content

Configuration⚓︎

Here you can find descriptions, examples and use cases for all global QTAF settings.

driver⚓︎

The driver settings are essential for the web driver to properly interact with your application.

options⚓︎

A list of browser options to pass to the web driver on instantiation.

Environment variable
DRIVER_OPTIONS
Type
string[]
Example
"driver": {
  "options": [
    "--headless",
    "--disable-gpu",
    "--ignore-certificate-errors",
    "--disable-extensions",
    "--no-sandbox",
    "--disable-dev-shm-usage"
  ]
}
DRIVER_OPTIONS="[--headless, --disable-gpu, --ignore-certificate-errors, --disable-extensions, --no-sandbox, --disable-dev-shm-usage]"

capabilities⚓︎

A capabilities object to pass to the web driver on instantiation.

Environment variable
DRIVER_CAPABILITIES
Type
JSON object
Example
1
2
3
4
5
6
7
"driver": {
  "capabilities": {
    "acceptInsecureCerts": true,
    "elementScrollBehavior": 1,
    "customCapability": [42, "yes", false]
  }
}
DRIVER_CAPABILITIES="{acceptInsecureCerts: true, elementScrollBehavior: 1, customCapability: [42, yes, false]}"

preferences⚓︎

Additional browser preferences to pass to the web driver options on instantiation.

Info

These preferences will be passed to the driver options as follows:

Environment variable
DRIVER_PREFERENCES
Type
JSON object
Example

The following will set the download directory in Chromium-based browsers to /home/me/downloads.

1
2
3
4
5
6
7
"driver": {
  "preferences": {
    "prefs": {
      "download.default_directory": "/home/me/downloads"
    }
  }
}
DRIVER_PREFERENCES="{prefs: {download.default_directory: /home/me/downloads}}"

Download Directory⚓︎

Chromium-based drivers⚓︎

You can set the download directory for Chrome and Edge in the following way:

1
2
3
4
5
6
7
"preferences": {
  "download": {
    "default_directory": "C:\\Users\\your_username",
    "prompt_for_download": false,
    "directory_upgrade": true
  }
}

Firefox⚓︎

When using the firefox webdriver you can change the download directory in the following way:

1
2
3
4
5
"preferences": {
  "browser.download.folderList": 2,
  "browser.download.manager.showWhenStarting": false,
  "browser.download.dir": "C:\\Users\\your_username",
}

Using variables⚓︎

You can also use the expressions $USER_DIR and $USER_HOME in your download path. $USER_HOME will be replaced by the home directory of the currently logged in user and $USER_DIR by the directory where the QTAF project is stored in.

For example you can save the downloads (for Chromium based drivers) in the resources directory of your project with the following configuration:

1
2
3
4
"preferences": {
  "download": {
    "default_directory": "$USER_DIR/src/test/resources",
}