Reputation: 17
I'm trying to take a screenshot by using the following code:
WebDriver driver = new FirefoxDriver();
driver.get("https://10.4.16.159/");
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile, new File("c:\\test\\screenshot.JPG"));
But I'm not able to take the screenshot.
Upvotes: 1
Views: 1156
Reputation: 59
Try to save screenshot to another disk partition, etc d:
FileUtils.copyFile(scrFile, new File("d:\\screenshot.JPG"));
. It seems like app just does not have permission to drive c:
Upvotes: 1