13

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!

Gokul
  • 788
  • 2
  • 12
  • 30
chhhris
  • 355
  • 1
  • 4
  • 16
  • Chromedriver requires an actual Chrome browser installed as well. Try upgrading your chrome browser. Also, can you manually start a Chrome session on the selenium hub - i.e. run `webdriver-manager start` then launch the hub portal at http://localhost:4444/wd/hub (or where ever you have configured it to be), click Create Session -> Chrome. – HaC Sep 27 '17 at 05:08

4 Answers4

18

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

emery
  • 8,603
  • 10
  • 44
  • 51
Aakash Singh
  • 209
  • 1
  • 4
3
  • Run webdriver-manager start
  • Open any browser manually, than navigate to 'localhost:4444/wd/hub' , click Create Session -> Chrome.
Liam
  • 27,717
  • 28
  • 128
  • 190
0

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',
Muck
  • 68
  • 1
  • 9
0

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
karthi keyan
  • 1
  • 1
  • 1