protractor fails to run with directConnect protractor fails to run with directConnect google-chrome google-chrome

protractor fails to run with directConnect


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.


ENOENT means Error, NO such ENTity, and relates to the file system.

Check you have the right path set in the chromeDriver option.

capabilities : { chromeOptions: { "debuggerAddress":"127.0.0.1:8088" } }, directConnect: true, chromeDriver : "../bin/chromedriver_2.15.322448.exe"