Created
December 8, 2012 06:54
-
-
Save siguremon/4238993 to your computer and use it in GitHub Desktop.
webdriverでスクリーンキャプチャ ref: http://qiita.com/items/34e8d443c543a5ff0591
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.commons.io.FileUtils; | |
import org.openqa.selenium.OutputType; | |
import org.openqa.selenium.TakesScreenshot; | |
File tmpFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE); | |
try { | |
FileUtils.copyFile(tmpFile, new File("tmp.png")); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment