title: Behat + mink + Selenium2 Get Current Browser Name
body: <p>How can I get the current browser name being used?  I'm using Chrome and Firefox with my feature tests going under features -&gt; chrome, features -&gt; firefox.  I want to take screenshots when a test fails. When I generate a screenshot, it just saves in my root dir. I want the file to be saved under the appropriate browser when I do this:</p>
  <pre><code>print_r($this-&gt;getSession()-&gt;getDriver())
  </code></pre>
  <p>I get that it has a private variable of browserName, but how do I access it?</p>
  <pre><code>[browserName:Behat\Mink\Driver\Selenium2Driver:private] =&gt; chrome
      [desiredCapabilities:Behat\Mink\Driver\Selenium2Driver:private] =&gt; Array
          (
              [browserName] =&gt; chrome
              [browser] =&gt; chrome
              [version] =&gt; 25
              [platform] =&gt; ANY
  </code></pre>