I am trying to take a screenshot of a webpage while selenium is running. I am using the following code for this purpose
WebDriver augmentedDriver = new Augmenter().augment(seleniumDriver);
File scrFile = ((TakesScreenshot)augmentedDriver).getScreenshotAs(OutputType.FILE);
Now it serves my purpose perfectly well except that whenever this method gets called the browser automatically gets into the default size and maximizes again.
And this continues every time the screenshot function gets called. I am able to solve the problem If I am NOT using the selenium webdriver for taking the screenshots and using other java functions.
I wanted to know if anyone had similar problems/why I am having this problem. And is there any workaround?