WebDriver driver = new FirefoxDriver(); driver.get("http://google.com/"); //Get the screenshot as file File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); // Copy the screenshot to your file system FileUtils.copyFile(scrFile, new File("c:\screenshots\screenshot.png"));
No comments:
Post a Comment