title: Take screenshot on test failure + exceptions
body: <p>Does any of you know possible solution for taking screenshots on test failures and exceptions?</p>
  
  <p>I've added following code in <code>TearDown()</code> but as a result it also makes screenshots on passed tests, so it is not the best solution:</p>
  
  <pre><code>DateTime time = DateTime.Now;
  string dateToday = "_date_" + time.ToString("yyyy-MM-dd") + "_time_" + time.ToString("HH-mm-ss");
  Screenshot screenshot = ((ITakesScreenshot)driver).GetScreenshot();
  screenshot.SaveAsFile((settings.filePathForScreenShots + "Exception" + dateToday + ".png"), System.Drawing.Imaging.ImageFormat.Png);
  </code></pre>
  
  <p>I've already found that idea: <a href="http://yizeng.me/2014/02/08/take-a-screenshot-on-exception-with-selenium-csharp-eventfiringwebdriver/" rel="noreferrer">http://yizeng.me/2014/02/08/take-a-screenshot-on-exception-with-selenium-csharp-eventfiringwebdriver/</a>, to use <code>WebDriverExceptionEventArgs</code>, but for some reasons it makes also some random screenshots without any reasonable explanation.</p>
  
  <p>Other ideas I found are for Java and not for NUnit which I use with Selenium, so they are pretty useless.</p>