Showing posts with label screenshot in selenium. Show all posts
Showing posts with label screenshot in selenium. Show all posts

Tuesday 7 January 2014

How to take the screen shots in seelnium 2.0



// store screenshots
public static void captureScreenShot(String filePath) {
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
   try {
FileUtils.copyFile(scrFile, new File(filePath));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();

}
   }

Back to Interview Questions and Answers