title: How to capture Screenshot in Selenium Webdriver using Java without Window being resized
body: <p>I am trying to take a screenshot of a webpage while selenium is running. I am using the following code for this purpose</p>
  
  <pre><code>WebDriver augmentedDriver = new Augmenter().augment(seleniumDriver);
              File scrFile = ((TakesScreenshot)augmentedDriver).getScreenshotAs(OutputType.FILE);
  </code></pre>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>I wanted to know if anyone had similar problems/why I am having this problem. And is there any workaround?</p>