ashot
ashot copied to clipboard
Black window appearing in screenshot
Code to repro:
String url = "https://i.pinimg.com/originals/b0/09/0d/b0090d60fe925d103368baf523478ff4.png";
getWebDriver().get(url);
findElement(By.tagName("img"), "image").shouldBe(visible);
WebElement webElement = getWebDriver().findElement(By.tagName("img"));
sleep(3000);
Screenshot screenshot = new AShot()
.coordsProvider(new WebDriverCoordsProvider())
.shootingStrategy(ShootingStrategies.viewportPasting(100))
.takeScreenshot(getWebDriver());
File actualFile = new File("arbit.png");
try {
ImageIO.write(screenshot.getImage(), "png", actualFile);
} catch (IOException e) {
e.printStackTrace();
}
Final screenshot:
Version: 1.5.4