title: Selenium WebDriver works but SLOW (Java)
body: <p>I am using Selenium WebDriver to take a screenshot of webpages. It runs great. However, from the time I hit run in eclipse to the time the screenshot shows up in my local drive is 7-10 seconds. Most of the latency seems to be launching Firefox. </p>
  
  <p>Code:</p>
  
  <pre class="lang-java prettyprint-override"><code>WebDriver driver = new FirefoxDriver();
  driver.get("http://www.cnn.com");
  File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
  FileUtils.copyFile(scrFile, new File("c:\\test\\screenshot.png"));
  </code></pre>
  
  <p>How can I speed up this process? Is there a way that I can use an already opened Firefox browser to save on opening a new one? Is this code somehow heavy?</p>
  
  <p>Details: Tried on CentOS box and Win7 box both using eclipse. myspeedtest.net shows 22Mbps down and 1 Mbps up.</p>