title: Using Bromine to take screenshots when Selenium test fails
body: <p>I'm new to Bromine and am struggling to find a way to take an automatic screenshot when the test fails. My test case in Bromine is as follows</p>
  
  <pre><code>&lt;?php
  
  set_include_path(get_include_path() . PATH_SEPARATOR . "drivers/php");
  require_once 'Testing/Selenium.php';
  require_once 'Testing/BRUnit.php';
  
  class Example extends BRUnit
  {
    function testMyTestCase()
    {
      $this-&gt;selenium-&gt;open("/index.php");
      // do some stuff    
      $this-&gt;verifyTrue($this-&gt;selenium-&gt;isTextPresent("Saved"));
    }
  
  }
  startTest("Example" , $argv);
  ?&gt;
  </code></pre>
  
  <p>I've seen that you can do <code>$this-&gt;selenium-&gt;captureScreenshotToString()</code> but dont know how to call this on a failure, any ideas?</p>
  
  <p>Thanks</p>