Update: While the solution below worked for me, after talking with a protractor dev I realized that if I run webdriver-manager update
to install a local chromedriver, then I don't need to set the chromeDriver
setting in my protractor config.
I had the same issue and solved it by varying the chromeDriver
path setting in protractor-conf.js depending on whether I was on Windows or OSX/Linux.
Solution and writeup below assumes you are using chromedriver provided by npm install chromedriver
. Also this solution worked with protractor 3.2.2
and chromedriver 2.21.2
.
Protractor+chromedriver worked on OSX and Linux but I was getting ENOENT errors on Windows. I have filed an issue here and have also documented a workaround.
The issue (I think) is that childProcess.spawn has issues on Windows (see a list of issues here) and the node_modules/chromedriver/bin/chromedriver
file will not correctly run when called via childProcess.spawn
- likely because this file is not executable and Windows doesn't know to use the node
binary to interpret the file.
The workaround is to provide the path to the windows executable when running on Windows. It is easy enough - though hackish - to vary the chromeDriver
arg in protractor-conf.js as demonstrated below :
protractor-conf.js for all three OS:
var chromeDriverPath = process.platform === 'win32' ? 'node_modules/chromedriver/lib/chromedriver/chromedriver.exe' : 'node_modules/chromedriver/bin/chromedriver';
exports.config = {
directConnect: true,
chromeDriver: chromeDriverPath,
specs: [
'features/*.feature'
],
capabilities: {
browserName: 'chrome',
platform: 'ANY',
chromeOptions: {
args: ['--test-type']
}
}
}
Hope this helps.
protractor
andchrome
versions are you using? Thanks. – alecxewebdriver-manager update
? – Andres D