I am using following code snipped to take screenshot in selenium 2.21.
augmentedDriver = new Augmenter().augment(driver);
File scrnshot = ((TakesScreenshot)augmentedDriver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrnshot, new File(File_Name));
Whenever i call method containing this code, it's launching new browser instances with text "This is the initial start page for the WebDriver server. "
driver = new new InternetExplorerDriver();
Please let me know the issue, as well as solution too.
I think, that this line:
Starts new Driver instance. But you need to give here:
Not augmentedDriver but existing driver instance.