четверг, 6 сентября 2012 г.

Take screenshots in Selenium webdriver (Java)

The similar way to create screenshots and put them in some folder on your computer when you use selenium webdriver:

File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile, new File(imagePath + "imageName.png"));