ChromeDriver Service
wdio-chromedriver-service is a 3rd party package, for more information please see GitHub | npm
(Based entirely on wdio-selenium-standalone-service.)
Note - starting with version 5.0.0, this service is targeted at WDIO v5. If you're working with WDIO v4, use latest version before 5.0.0!
This service helps you to run ChromeDriver seamlessly when running tests with the WDIO testrunner. It uses the chromedriver NPM package that wraps the ChromeDriver for you.
Note - this service does not require a Selenium server, but uses ChromeDriver to communicate with the browser directly. Obvisously, it only supports:
capabilities: [{
browserName: 'chrome'
}]
Installation
The easiest way is to keep wdio-chromedriver-service
as a devDependency in your package.json
.
{
"devDependencies": {
"wdio-chromedriver-service": "^5.0.0"
}
}
You can simple do it by:
npm install wdio-chromedriver-service --save-dev
Note! You have to install chromedriver separately, as it's a peerDependency of this project, and you're free to choose what version to use. Install it using:
npm install chromedriver --save-dev
Instructions on how to install WebdriverIO
can be found here.
Configuration
By design, only Google Chrome is available (when installed on the host system). In order to use the service you need to add chromedriver
to your service array:
// wdio.conf.js
export.config = {
// port to find chromedriver
port: 9515, // default for ChromeDriver
path: '/',
// ...
services: ['chromedriver'],
// options
chromeDriverArgs: ['--port=9515', '--url-base=\'/\''], // default for ChromeDriver
chromeDriverLogs: './',
// ...
};
Options
chromeDriverArgs
Array of arguments to pass to the ChromeDriver executable, see https://helpmanual.io/help/chromedriver.
--port
will use wdioConfig.port if not specified--url-base
will used wdioConfig.path if not specified
Type: string[]
chromeDriverLogs
Path where all logs from the ChromeDriver server should be stored.
Type: string
For more information on WebdriverIO see the homepage.