chhhris
chhhris

Reputation: 375

SessionNotCreatedError: Unable to create new service: ChromeDriverService

We have AngularJS protractor tests. The process is to set up and run these steps in order:

$ npm install
$ webdriver-manager update --ie32 --ignore_ssl
$ gulp

The problem I'm having is this setup works for everyone else on my team but 100% of the time I receive this error:

[11:42:33] I/local - Starting selenium standalone server...
[11:42:36] I/local - Selenium standalone server started at http://10.222.189.129:55574/wd/hub

/path/to/repo/node_modules/selenium-webdriver/lib/error.js:27
    super(opt_error);
    ^
SessionNotCreatedError: Unable to create new service: ChromeDriverService
Build info: version: '3.5.3', revision: 'a88d25fe6b', time: '2017-08-29T12:54:15.039Z'
System info: host: 'xxxx', ip: 'xxxx', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_131'
Driver info: driver.version: unknown
   at WebDriverError (/path/to/repo/node_modules/selenium-webdriver/lib/error.js:27:5)
   at SessionNotCreatedError (/path/to/repo/node_modules/selenium-webdriver/lib/error.js:214:5)
   at Object.checkLegacyResponse (/path/to/repo/node_modules/selenium-webdriver/lib/error.js:505:15)
   at parseHttpResponse (/path/to/repo/node_modules/selenium-webdriver/lib/http.js:509:13)
   at doSend.then.response (/path/to/repo/node_modules/selenium-webdriver/lib/http.js:440:13)
   at process._tickCallback (internal/process/next_tick.js:103:7)
From: Task: WebDriver.createSession()
   at Function.createSession (/path/to/repo/node_modules/selenium-webdriver/lib/webdriver.js:777:24)
   at Function.createSession (/path/to/repo/node_modules/selenium-webdriver/chrome.js:709:29)

The problem is something to do with my setup but I'm at a loss, so throwing a Hail Mary on SO hoping anyone has any advice.

Please let me know if you need any additional info. Thank you in advance, I've wasted a lot of time trying to get this to work!

Upvotes: 13

Views: 25805

Answers (4)

karthi keyan
karthi keyan

Reputation: 1

I faced the same issue. Just install or update the protractor. If you still installed the protractor also Do the following steps, run the following in cmd prompt or PowerShell

npm install protractor -g 

npm install webdriver-manager -g

If you got the error as running in the background, check the running processor and close all the running processor and try.

After the above steps run the following

webdriver-manager update
webdriver-manager start

Upvotes: 0

Nhan Tran Trong
Nhan Tran Trong

Reputation: 45

  • Run webdriver-manager start
  • Open any browser manually, than navigate to 'localhost:4444/wd/hub' , click Create Session -> Chrome.

Upvotes: 3

Muck
Muck

Reputation: 78

If you set the below in your config you can download the latest chromedriver.exe and run it directly with the below code. Only geckoDriver and chromeDriver work with directConnect.

directConnect: true,
chromeDriver: 'path_to_chromedriver',
geckoDriver: 'path_to_geckodriver.exe',

Upvotes: 0

Aakash Singh
Aakash Singh

Reputation: 209

This can be fixed by updating to the latest version of both chromedriver and chrome.

If you are using webdriver-manager, run

webdriver-manager update --chromedriver

Then download Chrome from https://www.google.com/chrome/browser/desktop/ and replace your old chrome with the latest version.

You will also need to Ctrl-C in the terminal where webdriver is running and run

webdriver-manager start

Or kill and restart the Selenium daemon process to capture the latest chromedriver. A system restart might be helpful.

Also worth trying:

npm update -g protractor
webdriver-manager update

Also see session not created exception for chrome in Protractor for more details on how to modify the version of Chromedriver in protractor's config

Lastly, make sure that your protractor.conf.js has

   commonCapabilities: {
     'browserName': 'chrome',
   },

or else you should be using

--browser chrome

flag on your protractor command

Upvotes: 18

Related Questions