WebdriverIO service to start & stop ChromeDriver
npm install wdio-chromedriver-serviceWDIO ChromeDriver Service
=========================
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.
Obviously, it only supports:
``js`
capabilities: [{
browserName: 'chrome'
}]
The easiest way is to keep wdio-chromedriver-service as a devDependency in your package.json.
`json`
{
"devDependencies": {
"wdio-chromedriver-service": "^8.0.0"
}
}
You can simple do it by:
`bash`
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. Depending of which version of Chrome you have installed on your system you should install the same version of chromedriver. Install it using:
`bash`
npm install chromedriver --save-devif you have Chrome 104 installed on your machine do
npm install chromedriver@104 --save-dev
Instructions on how to install WebdriverIO can be found here.
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:
`js`
// wdio.conf.js
export.config = {
outputDir: 'all-logs',
// ...
services: [
['chromedriver', {
logFileName: 'wdio-chromedriver.log', // default
outputDir: 'driver-logs', // overwrites the config.outputDir
args: ['--silent']
}]
],
// ...
};
Example: 7676
Type: number
Example: /
Type: string
Example: http
Type: string
Example: localhost
Type: string
Example: 10000
Type: number
Example: driver-logs
Type: string
.Example:
wdio-chromedriver.logType:
string$3
To use a custome chromedriver different than the one installed through "chromedriver npm module", provide the path.Example:
/path/to/chromedriver (Linux / MacOS), ./chromedriver.exe or d:/driver/chromedriver.exe (Windows)Type:
string`---
For more information on WebdriverIO see the homepage.