I am using Selenium WebDriver to take the screenshot of web pages. the time I hit run in eclipse to the time the screenshot shows up in my local drive is 7-10 seconds. There is a delay in the launching of Firefox.
Below is my Code:
WebDriver driver = new FirefoxDriver();
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile, new File("c:\\test\\screenshot.png"));
How to speed up the execution process?