On using this class augmentedDriver, it's launching unnecessary browser Instances

152 views Asked by At

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.

1

There are 1 answers

0
Ukrainis On

I think, that this line:

augmentedDriver = new Augmenter().augment(driver);

Starts new Driver instance. But you need to give here:

File scrnshot = ((TakesScreenshot)augmentedDriver).getScreenshotAs(OutputType.FILE);

Not augmentedDriver but existing driver instance.