3
Good afternoon, everyone.
I am using Firefoxdriver in version 2.53.0 and when taking snapshot of a site is being generated an image with very large dimensions (111159x17555).
Does anyone know a way to fix this problem?
I have tried to define the browser dimension with the following code:
driver.manage().window().setSize(new Dimension(1366, 768));
And the problem persisted.
Follow the example of a snapshot that was generated.
Follow the code used to take the snapshot:
public static void saveScreenshot(WebDriver driver, String path) {
File scrFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
try {
FileUtils.copyFile(scrFile, new File(path));
} catch (IOException e) {
e.printStackTrace();
}
}
You could post the code you’re using to take the screenshoot? (e.g., all the way up to the part where you call
getScreenshotAs
).– Anthony Accioly
I added the code to the post.
– helciodasilva