This is rather quick. First of all, you need a fully working Behat and Selenium2 setup working, using Firefox as default. Once you achieved this, we can change it to use Google Chrome.
First, download chromedriver
at https://code.google.com/p/selenium/wiki/ChromeDriver and put it somewhere like /data/lib/chromedriver
. Once done, we run our Selenium2 java jar file like this:
java -jar selenium-server-standalone-2.44.0.jar -Dwebdriver.chrome.driver="/data/lib/chromedriver"
Then in our behat.yml
file, we set the browser setting like this.
default: extensions: Behat\MinkExtension: base_url: someurl goutte: ~ default_session: goutte javascript_session: selenium2 browser_name: 'chrome' zombie: node_modules_path: 'somepath...' selenium2: capabilities: { "browserName": "chrome", "browser": "chrome", "version": "29", 'chrome': {'switches':['--no-sandbox']}}
That’s it. It should launch Chrome instead of Firefox.
if you get an exception : reverse the order , so instead of adding -Dwebdriver in the end , add it directly after the -jar , then write the selenium jar
java -jar -Dwebdriver.chrome.driver=”/data/lib/chromedriver” selenium-server-standalone-2.44.0.jar