Configuration
Based on the setup type (e.g. using the raw protocol bindings, WebdriverIO as standalone package or the WDIO testrunner) there is a different set of options available to control the environment.
WebDriver Options
The following options are defined when using the webdriver
protocol package:
protocol
Protocol to use when communicating with the driver server.
Type: String
Default: http
hostname
Host of your driver server.
Type: String
Default: localhost
port
Port your driver server is on.
Type: Number
Default: 4444
path
Path to driver server endpoint.
Type: String
Default: /
queryParams
Query parameters that are propagated to the driver server.
Type: Object
Default: null
user
Your cloud service username (only works for Sauce Labs, Browserstack, TestingBot or LambdaTest accounts). If set, WebdriverIO will automatically set connection options for you. If you don't use a cloud provider this can be used to authenticate any other WebDriver backend.
Type: String
Default: null
key
Your cloud service access key or secret key (only works for Sauce Labs, Browserstack, TestingBot or LambdaTest accounts). If set, WebdriverIO will automatically set connection options for you. If you don't use a cloud provider this can be used to authenticate any other WebDriver backend.
Type: String
Default: null
capabilities
Defines the capabilities you want to run in your WebDriver session. Check out the WebDriver Protocol for more details. If you run an older driver that doesn't support the WebDriver protocol, you’ll need to use the JSONWireProtocol capabilities to successfully run a session.
Next to the WebDriver based capabilities you can apply browser and vendor specific options that allow deeper configuration to the remote browser or device. These are documented in the corresponding vendor docs, e.g.:
goog:chromeOptions
: for Google Chromemoz:firefoxOptions
: for Mozilla Firefoxms:edgeOptions
: for Microsoft Edgesauce:options
: for Sauce Labsbstack:options
: for BrowserStackselenoid:options
: for Selenoid
Additionally, a useful utility is the Sauce Labs Automated Test Configurator, which helps you create this object by clicking together your desired capabilities.
Type: Object
Default: null
Example:
{
browserName: 'chrome', // options: `chrome`, `edge`, `firefox`, `safari`
browserVersion: '27.0', // browser version
platformName: 'Windows 10' // OS platform
}
If you’re running web or native tests on mobile devices, capabilities
differs from the WebDriver protocol. See the Appium Docs for more details.
logLevel
Level of logging verbosity.
Type: String
Default: info
Options: trace
| debug
| info
| warn
| error
| silent
outputDir
Directory to store all testrunner log files (including reporter logs and wdio
logs). If not set, all logs are streamed to stdout
. Since most reporters are made to log to stdout
, it is recommended to only use this option for specific reporters where it makes more sense to push report into a file (like the junit
reporter, for example).
When running in standalone mode, the only log generated by WebdriverIO will be the wdio
log.
Type: String
Default: null
connectionRetryTimeout
Timeout for any WebDriver request to a driver or grid.
Type: Number
Default: 120000
connectionRetryCount
Maximum count of request retries to the Selenium server.
Type: Number
Default: 3