top of page

Print screen , screenshot
@Test
public void a_test() throws IOException
{
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
//The below method will save the screen shot in d drive with name "screenshot.png"
FileUtils.copyFile(scrFile, new File("C:\\test\\screenshot.png"));
}
bottom of page