title: Behat-Mink, force Selenium driver to use Chrome instead of Firefox
body: <p>So I want to run my tests in Chrome instead of Firefox (because Chrome offers mobile emulation capability) when using Selenium driver with Behat's Mink extension.</p>
  
  <p>I'm running Selenium stand alone on a testing server, and running tests on a local machine.</p>
  
  <p>So after running Behat tests, a Chrome session is created but is not used, instead, another parallel Firefox session also get created and gets used to run the test scenarios.</p>
  
  <p>I tried that also in an environment with graphical display abilities, so a new Chrome window opens but only <code>data;;</code> is displayed in the address bar, then afterwards a Firefox window opens and tests are run there.</p>
  
  <p>I'm running the latest version of Chrome (52.0.2743.82), Selenium standalone server (2.53.1 - Java version) and Chromedriver (2.22.397932)</p>
  
  <p>My <code>behat.yml</code> contains the following:</p>
  
  <pre><code>default:
      extensions:
          Behat\MinkExtension:
              browser_name: chrome
              base_url: "&lt;url to website&gt;"
              default_session: selenium_chrome_session
              goutte: ~
              sessions:
                  selenium_chrome_session:
                      selenium2:
                          browser: chrome
                          wd_host: "http://&lt;testing server host&gt;:4444/wd/hub"
                          capabilities:
                              extra_capabilities:
                                  chromeOptions:
                                      args:
                                          - "--start-maximized"
                                          - "--test_type"
  </code></pre>
  
  <p>After looking at Selenium standalone server's logfile, I get the following output:</p>
  
  <pre><code>15:44:47.677 INFO [45] org.openqa.selenium.remote.server.DriverServlet - Executing: [new session: Capabilities [{chrome.switches=[--no-sandbox], browser=chrome, name=Behat feature suite, browserName=chrome, chrome.extensions=[], ignoreZoomSetting=false, chromeOptions={args=[--no-sandbox], extensions=[]}, version=, tags=[PHP 5.6.21-1~dotdeb+7.1]}]])
  15:44:47.678 INFO [113] org.openqa.selenium.remote.server.DefaultDriverProvider - Creating a new session for Capabilities [{chrome.switches=[--no-sandbox], browser=chrome, name=Behat feature suite, browserName=chrome, chrome.extensions=[], ignoreZoomSetting=false, chromeOptions={args=[--no-sandbox], extensions=[]}, version=, tags=[PHP 5.6.21-1~dotdeb+7.1]}]
  15:44:48.021 INFO [45] org.openqa.selenium.remote.server.DriverServlet - Done: [new session: Capabilities [{chrome.switches=[--no-sandbox], browser=chrome, name=Behat feature suite, browserName=chrome, chrome.extensions=[], ignoreZoomSetting=false, chromeOptions={args=[--no-sandbox], extensions=[]}, version=, tags=[PHP 5.6.21-1~dotdeb+7.1]}]]
  15:44:48.035 INFO [45] org.openqa.selenium.remote.server.DriverServlet - Executing: [new session: Capabilities [{deviceType=tablet, selenium-version=2.31.0, browserVersion=9, browser=firefox, name=Behat Test, browserName=firefox, deviceOrientation=portrait, version=9, platform=ANY}]])
  15:44:48.036 INFO [120] org.openqa.selenium.remote.server.FirefoxDriverProvider - Creating a new session for Capabilities [{deviceType=tablet, selenium-version=2.31.0, browserVersion=9, browser=firefox, name=Behat Test, browserName=firefox, deviceOrientation=portrait, version=9, platform=ANY}]
  </code></pre>
  
  <p>As you can see, Chrome session is successfully created, and then a new Firefox session is created afterwards and is used to conduct tests.</p>