Program to take screenshot in webdriver
public class Test1 {
@Test
public void TestC() throws IOException
{
FirefoxDriver f = new FirefoxDriver();
f.get("http://www.rediffmail.com/");
Set<String> winh= f.getWindowHandles();
Iterator iter= winh.iterator();
File fnew= f.getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(fnew, new File("C:\\abc111.png"));
}
}
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment