I have a problem with capturing screenshot in my local machine. I use FF and IE10 and for FF everything works fine, the screenshots get captured with full size of window. For IE10 I get half of the lower part of the page black and it seems that it is related to scrolling, whenever there is scroll in the page the black bar is seen, otherwise not. I suspect a timing issue, that it might take longer time for IE to capture the whole page.
I have the following code for capturing:
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());
}
}
It seems that I have the exact same problem as stated here: http://selenium.10932.n7.nabble.com/TakeScreenshot-from-Augmenter-RemoteWebdriver-gets-window-only-for-IE-10-others-get-entire-page-td18063.html
DOM loading for FF is much more faster that IE. For IE, wait till the document gets in ready state using JS.
do
{
// sleep for few milliseconds.
} while ((string)ie.ExecuteScript("return document.readyState") != "complete");
(Coded using C# - Pseudo code, not complied)