You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use AShot to Shot Screen,error is exit.
My source:
private void captureImage(WebDriver driver, String filePath, float quality) throws IOException {
JPEGImageWriteParam param = new JPEGImageWriteParam(Locale.getDefault());
param.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
param.setCompressionQuality(quality);
// 150はミリ秒でスクロールを待つ時間、短すぎるとダメな模様
**ShootingStrategy ss = ShootingStrategies.viewportPasting(150);
Screenshot screenshot = new AShot().shootingStrategy(ss).takeScreenshot(driver);**
ImageWriter writer = null;
try {
writer = ImageIO.getImageWritersByFormatName("jpg").next();
writer.setOutput(ImageIO.createImageOutputStream(new File(filePath)));
writer.write(null, new IIOImage(screenshot.getImage(), null, null), param);
} finally {
if (writer != null) {
writer.dispose();
}
}
}
when the project is running, ShootingStrategy ss.shottingArea are NULL!
how can i solve this issue
The text was updated successfully, but these errors were encountered:
When I use AShot to Shot Screen,error is exit.
My source:
private void captureImage(WebDriver driver, String filePath, float quality) throws IOException {
JPEGImageWriteParam param = new JPEGImageWriteParam(Locale.getDefault());
param.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
param.setCompressionQuality(quality);
}
when the project is running, ShootingStrategy ss.shottingArea are NULL!
how can i solve this issue
The text was updated successfully, but these errors were encountered: