Behat, Selenium and Chromedriver CI errors I am working on a Behat setup with Selenium and Chromedriver for running Behat tests for a Drupal 7 setup.

I am getting:


  exception ‘WebDriver\Exception\UnknownError’ with message 'Timed out
  waiting for driver server to start.


Above this error, i am also seeing:


  21:46:42.198 INFO [ActiveSessionFactory.apply] - Capabilities are:
  Capabilities {browser: firefox, browserName: chrome,
  ignoreZoomSetting: false, name: Behat feature suite, tags:
  [railsonfire_5e8a4d2e-8ba4-4…, PHP 5.6.34]} 21:46:42.199 INFO
  [ActiveSessionFactory.lambda$apply$11] - Matched factory
  org.openqa.selenium.remote.server.ServicedSession$Factory (provider:
  org.openqa.selenium.chrome.ChromeDriverService)
  /home/rof/src/bitbucket.org/myorganisation/myproject/chromedriver: 1:
  /home/rof/src/bitbucket.org/myorganisation/myproject/chromedriver:
  Syntax error: “(” unexpected 21:47:02.201 ERROR
  [OsProcess.checkForError] - org.apache.commons.exec.ExecuteException:
  Process exited with an error: 2 (Exit value: 2)


I am running:

java -Dwebdriver.chrome.driver=./chromedriver -jar selenium-server-standalone-3.10.0.jar 2&gt;&amp;1 &amp;


to start selenium with chromedriver in my pipeline.

I am downloading and unzipping chromedriver like so:


  –2018-03-19 20:39:43--
  http://chromedriver.storage.googleapis.com/2.35/chromedriver_mac64.zip
  Resolving chromedriver.storage.googleapis.com
  (chromedriver.storage.googleapis.com)… 172.217.7.176,
  2607:f8b0:4004:80c::2010 Connecting to
  chromedriver.storage.googleapis.com
  (chromedriver.storage.googleapis.com)|172.217.7.176|:80… connected.
  HTTP request sent, awaiting response… 200 OK Length: 5508030 (5.3M)
  [application/zip] Saving to: chromedriver_mac64.zip
  
  100%[======================================>] 5,508,030 --.-K/s in
  0.04s
  
  2018-03-19 20:39:44 (120 MB/s) - chromedriver_mac64.zip saved
  [5508030/5508030]
  
  Archive: chromedriver_mac64.zip inflating:
  /home/rof/src/bitbucket.org/myorganisation/myproject/chromedriver


My behat.yml file used for CI

default:
  suites:
    default:
      contexts:
        - FeatureContext
        - Drupal\DrupalExtension\Context\DrupalContext
        - Drupal\DrupalExtension\Context\MinkContext
        - Drupal\DrupalExtension\Context\MessageContext
        - Drupal\DrupalExtension\Context\DrushContext
     filters:
      tags: "~@wip"
  extensions:
    Behat\MinkExtension:
      goutte: ~
      javascript_session: 'selenium2'
      browser_name: 'chrome'
      selenium2:
      wd_host: 'http://127.0.0.1:4444/wd/hub'
    # Should be removed once 
    https://github.com/Behat/MinkExtension/pull/311 gets into a release.
      capabilities:
        marionette: null
    # Remove STOP
    base_url: 'http://127.0.0.1:8080'
  Drupal\DrupalExtension:
    blackbox: ~
    api_driver: 'drupal'
    drupal:
      drupal_root: '${project.basedir}'
    text:
      username_field: 'Gebruikersnaam'
      password_field: 'Wachtwoord'
      log_in: 'Log in'
      log_out: 'Uitloggen'


Please ignore the ${project.basedir}, this gets replaced with the phing build target.

Ps: Also note that locally all behat tests run perfectly fine.

All suggestions welcome!
Apparently Codeship, the CI provider that I am using, had a different version of chromedriver that conflicted with my setup.
Running chromedriver 2.35 fixed the problem.

Many thanks Aswini K for the effort provided though!