【发布时间】:2014-11-21 20:02:05
【问题描述】:
我在本地机器上截屏时遇到问题。我使用 FF 和 IE10,对于 FF,一切正常,屏幕截图以全尺寸窗口捕获。 对于 IE10,我将页面下部的一半变为黑色,这似乎与滚动有关,只要页面中有滚动,就会看到黑条,否则不会。我怀疑是时间问题,IE 捕获整个页面可能需要更长的时间。
我有以下代码用于捕获:
public static void takeScreenshot(String filename)
{
WebDriver augmentedDriver = new Augmenter().augment(AbstractTest.driver);
File screenshotFile=((TakesScreenshot)augmentedDriver).getScreenshotAs(OutputType.FILE);
try
{
FileUtils.copyFile(screenshotFile, new File(getScreenshotsDir() + filename));
}
catch (IOException e)
{
System.out.println("Cannot capture sreenshot." + e.getMessage());
}
}
似乎我遇到了与此处所述完全相同的问题: http://selenium.10932.n7.nabble.com/TakeScreenshot-from-Augmenter-RemoteWebdriver-gets-window-only-for-IE-10-others-get-entire-page-td18063.html
【问题讨论】:
标签: java selenium webdriver internet-explorer-10