Code to take screenshot
The "." sign will make sure that the screenshot is stored in current test run directory
Here Screenshot folder has been added to the test. And the screen shot will be saved here.
Main Code:
public void tcu() throws Exception{
driver.manage().window().maximize();
driver.get("https://mail.rediff.com/cgi-bin/login.cgi");
TakesScreenshot ts = (TakesScreenshot)driver;
File source = ts.getScreenshotAs(OutputType.FILE);
FileHandler.copy(source, new File("./screenshot/na.jpg"));
driver.close();
}
Take ScreenShot in Selenium
Tags
# SELENIUM
About Unknown
Soratemplates is a blogger resources site is a provider of high quality blogger template with premium looking layout and robust design. The main mission of templatesyard is to provide the best quality blogger templates.
SELENIUM
Labels:
SELENIUM
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment