title: How to take screen shot for failed test cases using selenium webdriver in Java?
body: <p>Can any one please help taking screen shots and saving on specific folder on Mac while running selenium webdriver automation scripts using java??</p>
  
  <p>Note: I used static in my code so i cannot use below code</p>
  
  <pre><code>File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
  FileUtils.copyFile(scrFile, new File("D:\\screenshot.jpg"));
  </code></pre>
  
  <p>Thanks in advance !!</p>