How Can I take Screenshot using selenium Webdriver
inna last edited by
Hello , please tell me how can i take the screenshot of webpage by using selenium Webdriver in java ??
Alberto last edited by
Yes, it is possible. The following example is in Java:
WebDriver driver = new FirefoxDriver(); driver.get("http://www.google.com/"); File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); // Now you can do whatever you need to do with it, for example copy somewhere FileUtils.copyFile(scrFile, new File("c:\\tmp\\screenshot.png"));
This answer has been lifted from stackoverflow and written by Sergii Pozharov as the question could be useful to others within SQA.