3

I'm not new to setting up Selenium and Mink, but it always seems to be a hassle. This time I'm trying to get it set up in an ubuntu docker container and I am running into the following error:

  Could not open connection: Unable to create new service: ChromeDriverService
  Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T19:05:32.194Z'
  System info: host: 'a75b4026b8e5', ip: '172.20.0.6', os.name: 'Linux', os.arch: 'amd64', os.version: '4.9.60-linuxkit-aufs', java.version: '1.8.0_161'
  Driver info: driver.version: unknown (Behat\Mink\Exception\DriverException)

I can tell that Mink is hitting the Selenium to some degree, since the Selenium server outputs the following immediately before Behat reports the above error:

2018-01-30 16:13:49.870:INFO:osjshC.ROOT:qtp1156060786-12: org.openqa.selenium.remote.server.WebDriverServlet-10bbd20a: Initialising WebDriverServlet
16:13:49.988 INFO - Found handler: org.openqa.selenium.remote.server.commandhandler.BeginSession@4b4945b7
16:13:50.006 INFO - /session: Executing POST on /session (handler: BeginSession)
16:13:50.168 INFO - Capabilities are: Capabilities {browser: chrome, browserName: chrome, ignoreZoomSetting: false, marionette: true, name: Behat feature suite, tags: [a75b4026b8e5, PHP 5.6.31]}
16:13:50.171 INFO - Capabilities {browser: chrome, browserName: chrome, ignoreZoomSetting: false, marionette: true, name: Behat feature suite, tags: [a75b4026b8e5, PHP 5.6.31]} matched class org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
16:13:50.302 INFO - Found handler: org.openqa.selenium.remote.server.commandhandler.BeginSession@5a608e4b
16:13:50.303 INFO - /session: Executing POST on /session (handler: BeginSession)
16:13:50.306 INFO - Capabilities are: Capabilities {browser: chrome, browserName: chrome, ignoreZoomSetting: false, marionette: true, name: Behat feature suite, tags: [a75b4026b8e5, PHP 5.6.31]}
16:13:50.307 INFO - Capabilities {browser: chrome, browserName: chrome, ignoreZoomSetting: false, marionette: true, name: Behat feature suite, tags: [a75b4026b8e5, PHP 5.6.31]} matched class org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)

Any idea what setting I have wrong?

Here's my setup:

Version of the chromedriver I installed:

https://chromedriver.storage.googleapis.com/2.35/chromedriver_linux64.zip

Version of Chrome I have installed via the apt-get install google-chrome-stable command:

Google Chrome 64.0.3282.119

Java version that's installed:

java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)

How I started selenium:

xvfb-run --server-args="-screen 0, 1366x768x24" java -Dwebdriver.chrome.driver="usr/bin/chromedriver" -jar selenium-server-standalone-3.8.1.jar &

composer.json:

    ...
    "require-dev": {
        "behat/behat": "^3.1",
        "behat/mink": "^1.7",
        "behat/mink-extension": "^2.2",
        "behat/mink-goutte-driver": "^1.2",
        "behat/mink-selenium2-driver": "^1.3",
       ...
    }, 

behat.yml:

extensions:
    Behat\MinkExtension:
      goutte: ~
      base_url: http://localhost/myapp/
      browser_name: chrome
      javascript_session: selenium2
      default_session: goutte
      selenium2:
        wd_host: "http://127.0.0.1:4444/wd/hub"
        capabilities:
          marionette: true
          browser: chrome
          version: 2.9
hacklan07
  • 188
  • 1
  • 10
  • Try to remove double quotes from `"usr/bin/chromedriver"` and if you don't have multiple versions of chrome then you can also remove `version` – lauda Jan 30 '18 at 15:52
  • Thanks @lauda. I just gave those two things a shot but the exact same error still persists. – hacklan07 Jan 30 '18 at 16:14
  • also make sure `wd_host` has the ip of the selenium server. – lauda Jan 31 '18 at 08:29
  • Fixed [here](https://stackoverflow.com/questions/48834963/selenium-server-error-unable-to-create-new-service-chromedriverservice). Update your chromedriver `Driver info: driver.version: unknown ` – nilsM Feb 04 '19 at 15:08

0 Answers0