Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to take a screenshot in selenium

Java
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:	mpscreenshot.png"));
Source by pythonbasics.org #
 
PREVIOUS NEXT
Tagged: #screenshot #selenium
ADD COMMENT
Topic
Name
7+2 =