Protractor gives "Unable to start a WebDriver session" error Protractor gives "Unable to start a WebDriver session" error google-chrome google-chrome

Protractor gives "Unable to start a WebDriver session" error


According to the relevant github issue, the problem is that chromedriver cannot find chrome browser executeable - on different operating systems it searches for it in different places.

You need to either have chrome installed where chromedriver expects it to be, or specify the path to the chrome executeable in the binary setting:

capabilities: {    "browserName": "chrome",    "chromeOptions": {        binary: "D:/Program Files/Chrome/chrome.exe",        args: [],        extensions: [],    }},


I generated code using JHipster and had similar error where e2e was not working. I provided binary path. But upon npm run e2e the browser opened and displayed data; in the address bar.

I shuffled and provided the binary at the end of chromeOptions after the args and it worked.

capabilities: {        browserName: 'chrome',        chromeOptions: {            args: process.env.JHI_E2E_HEADLESS                ? [ "--headless", "--disable-gpu", "--window-size=800,600" ]                : [ "--disable-gpu", "--window-size=800,600" ],            binary: "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"        }    }

Note: I also had to update the chrome version when an unsupported webdriver version error occurred.