Selenium: [Facebook\WebDriver\Exception\SessionNotCreatedException] Unable to create new service: ChromeDriverService

Created on 6 Oct 2017  路  19Comments  路  Source: SeleniumHQ/selenium

Meta -

OS: MAC

Selenium Version: 3.6

Browser: Chrome, Firefox

Browser Version:
Chrome Version - 61.0.3163.100

Firefox Version - 56.0 (64-bit)

Expected Behavior -

It should open the browser and script should run

Actual Behavior -

Script is not running.

Check the log here -
Selenium Log -

11:52:26.038 INFO - Selenium build info: version: '3.6.0', revision: '6fbf3ec767'
11:52:26.038 INFO - Launching a standalone Selenium Server
2017-10-06 11:52:26.069:INFO::main: Logging initialized @333ms to org.seleniumhq.jetty9.util.log.StdErrLog
11:52:26.135 INFO - Driver class not found: com.opera.core.systems.OperaDriver
11:52:26.172 INFO - Driver provider class org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
 registration capabilities Capabilities [{ensureCleanSession=true, browserName=internet explorer, version=, platform=WINDOWS}] does not match the current platform MAC
11:52:26.172 INFO - Driver provider class org.openqa.selenium.edge.EdgeDriver registration is skipped:
 registration capabilities Capabilities [{browserName=MicrosoftEdge, version=, platform=WINDOWS}] does not match the current platform MAC
11:52:26.227 INFO - Using the passthrough mode handler
2017-10-06 11:52:26.270:INFO:osjs.Server:main: jetty-9.4.5.v20170502
2017-10-06 11:52:26.303:WARN:osjs.SecurityHandler:main: [email protected]@eec5a4a{/,null,STARTING} has uncovered http methods for path: /
2017-10-06 11:52:26.310:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler@eec5a4a{/,null,AVAILABLE}
2017-10-06 11:52:26.354:INFO:osjs.AbstractConnector:main: Started ServerConnector@9660f4e{HTTP/1.1,[http/1.1]}{0.0.0.0:4444}
2017-10-06 11:52:26.356:INFO:osjs.Server:main: Started @620ms
11:52:26.356 INFO - Selenium Server is up and running
2017-10-06 11:52:38.203:INFO:osjshC.ROOT:qtp971848845-11: org.openqa.selenium.remote.server.WebDriverServlet-28d25987: Initialising WebDriverServlet
11:52:38.254 INFO - Binding default provider to: org.openqa.selenium.chrome.ChromeDriverService
11:52:38.255 INFO - Found handler: org.openqa.selenium.remote.server.commandhandler.BeginSession@124a951f
11:52:38.260 INFO - /session: Executing POST on /session (handler: BeginSession)
11:52:38.326 INFO - Capabilities are: Capabilities {browserName=chrome}
11:52:38.327 INFO - Capabilities {browserName=chrome} matched class org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
11:52:38.328 INFO - Capabilities {browserName=chrome} matched class org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)

Script Log -

Test  tests/acceptance/testCept.php

  [Facebook\WebDriver\Exception\SessionNotCreatedException] Unable to create new service: ChromeDriverService
Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T16:15:40.131Z'
System info: host: 'krupa.local', ip: '192.168.0.100', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_111'
Driver info: driver.version: unknown  

Steps to reproduce -


I am running my script for codeception test. Once I run the script it thorws the exception shown above.

Please help me to fix this issue.

R-awaiting answer

Most helpful comment

I had the same issue
the resolving might looks stupid but it helpd to me
I just download the latest chromedriver.exe and put it to the same folder where Selenium Standalone Server is loacated
run the server one more time and now everything works as expected

All 19 comments

Please provide concise reproducible test case so that we could act on this issue.

See CONTRIBUTING.md.

And I'm not sure Facebook PHP binding is compatible with Selenium 3.6.

I am running test using codeception. my config file as mentioned below.

lass_name: AcceptanceTester
modules:
    enabled:
        - \Helper\Acceptance
        - WPWebDriver
    config:
        WPWebDriver:
            url: 'http://localhost/demo/'
            # browser: 'firefox'
            browser: 'chrome'
            adminUsername: ''
            adminPassword: ''
            adminPath: '/wp-admin'

As per the information given here I just need to specify the browser name in config file.

To run the test I am using the below command -

java -Dwebdriver.chrome.driver=chromedriver -jar selenium-server-standalone-3.xx.xxx.jar

And I this is my command to run the test -
codecept run acceptance
After running the command I get output as mentioned in query posted.

Are you sure that chromedriver is available at this path and executable?

This is the output of sudo vim /etc/paths

/usr/local/bin
/usr/bin

My chromedriver and geckodriver are inside user/local/bin directory.

Then why do you add -Dwebdriver.chrome.driver=chromedriver to server arguments? Try without it.

I already tried that. But it throws the same exception! :(

What happens when you run chromedriver in terminal?

This is the output of Chromedriver in terminal

Starting ChromeDriver 2.33.506106 (8a06c39c4582fbfbab6966dbb1c38a9173bfb1a2) on port 9515
Only local connections are allowed.

Running the test will throw the same exception.

[Facebook\WebDriver\Exception\SessionNotCreatedException] Unable to create new service: ChromeDriverService Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T16:15:40.131Z' System info: host: 'krupa.local', ip: '192.168.0.100', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_111' Driver info: driver.version: unknown

Following the discussion in Codeception/Codeception#4556, this has to be addressed in PHP bindings in order to work with recent Selenium server.

I see the similar issue using Protractor, it was working fine until last week on which day chrome driver and selenium updated. I tried all the tricks cleaning all the node related things including uninstalling and installing Protractor, Visual Studio Code, npm, selenium etc...
I am giving upon it now, funny thing is it works on our testing machine which seem to have similarly configured.
12:03:55] E/launcher - Timed out waiting for driver server to start.
Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T16:15:40.131Z'
System info: host: 'Jag-MW.local', ip: 'fe80:0:0:0:1091:ce48:79f7:df2%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_144'
Driver info: driver.version: unknown
[12:03:55] E/launcher - WebDriverError: Timed out waiting for driver server to start.
Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T16:15:40.131Z'
System info: host: 'Jag-MW.local', ip: 'fe80:0:0:0:1091:ce48:79f7:df2%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_144'
Driver info: driver.version: unknown
at WebDriverError (/*/.nvm/versions/node/v6.11.4/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:27:5)
at Object.checkLegacyResponse (/*/.nvm/versions/node/v6.11.4/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:505:15)
at parseHttpResponse (/*/.nvm/versions/node/v6.11.4/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:509:13)
at doSend.then.response (/*/.nvm/versions/node/v6.11.4/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:440:13)
at process._tickCallback (internal/process/next_tick.js:109:7)
From: Task: WebDriver.createSession()
at Function.createSession (/*/.nvm/versions/node/v6.11.4/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:777:24)
at Function.createSession (/*/.nvm/versions/node/v6.11.4/lib/node_modules/protractor/node_modules/selenium-webdriver/chrome.js:709:29)
at createDriver (/*/.nvm/versions/node/v6.11.4/lib/node_modules/protractor/node_modules/selenium-webdriver/index.js:167:33)
at Builder.build (/*/.nvm/versions/node/v6.11.4/lib/node_modules/protractor/node_modules/selenium-webdriver/index.js:623:16)
at Hosted.getNewDriver (/*/.nvm/versions/node/v6.11.4/lib/node_modules/protractor/lib/driverProviders/driverProvider.ts:60:29)
at Runner.createBrowser (/*/.nvm/versions/node/v6.11.4/lib/node_modules/protractor/lib/runner.ts:225:39)
at q.then.then (/*/.nvm/versions/node/v6.11.4/lib/node_modules/protractor/lib/runner.ts:391:27)
at _fulfilled (/*/.nvm/versions/node/v6.11.4/lib/node_modules/protractor/node_modules/q/q.js:834:54)
at self.promiseDispatch.done (/*/.nvm/versions/node/v6.11.4/lib/node_modules/protractor/node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch (/*/.nvm/versions/node/v6.11.4/lib/node_modules/protractor/node_modules/q/q.js:796:13)
[12:03:55] E/launcher - Process exited with error code 199

whats the resolution for this?

At least in my case, reason for this error was that my /etc/hosts file was missing localhost entry as I changed the file for some testing. After a while when I was tracing back what I did, realized about it.

I had the same issue
the resolving might looks stupid but it helpd to me
I just download the latest chromedriver.exe and put it to the same folder where Selenium Standalone Server is loacated
run the server one more time and now everything works as expected

I had the same issue
the resolving might looks stupid but it helpd to me
I just download the latest chromedriver.exe and put it to the same folder where Selenium Standalone Server is loacated
run the server one more time and now everything works as expected

Thank you. 馃憤

I had the same issue
the resolving might looks stupid but it helpd to me
I just download the latest chromedriver.exe and put it to the same folder where Selenium Standalone Server is loacated
run the server one more time and now everything works as expected

Worked for me.. Thank you

I had the same issue
the resolving might looks stupid but it helpd to me
I just download the latest chromedriver.exe and put it to the same folder where Selenium Standalone Server is loacated
run the server one more time and now everything works as expected

YOU ARE THE BEST !!!

AS kuzmenko86 commented on Mar 22, 2018, Is success solution for my problem too. Now I can run selenium driver on my server. Thanks a lot.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings