我想捕捉屏幕的http://www.flipkart.com使用硒与Firefox。硒屏幕捕捉 - 图像不可用
public class App {
private static final String APP_URL = "http://www.flipkart.com";
public static void main(String[] args) {
WebDriver webDriver = null;
try {
webDriver = new FirefoxDriver();
webDriver.get(APP_URL);
webDriver.manage().window().maximize();
if (webDriver instanceof TakesScreenshot) {
TakesScreenshot screenshot = (TakesScreenshot) webDriver;
File imageFile = screenshot.getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(imageFile, new File(
"C:\\Captures\\captured.png"));
}
} catch (Exception e) {
e.printStackTrace();
} finally {
if (webDriver != null) {
webDriver.quit();
}
}
}
}
它需要整页的屏幕截图,但它显示的内页图像许多其他图像不可用。我无法纠正它。帮我。
这工作完美,似乎是页面滚动时加载图像 –