-1

I am running a webdriver test to capture screenshots on IE8/ WinXP machine. The code is simple -

WebDriver driver = new InternetExplorerDriver();
driver.get("http://www.google.com/");
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile, new File("c:\\tmp\\screenshot.png"));

When I run this, a screenshot.png file with size 0KB is generated. I am able to generate screenshots for all other browsers easily, and also on IE8 for Win7. Its failing only for IE8 on WinXP. Any pointers?

Umang
  • 583
  • 2
  • 12
  • 28

2 Answers2

0

There are no pointers for taking screen shot. I have used the same code in my machine and it took the screen shot. Try again. if it still does not work then upgrade to IE9 in which there are no issues with IE9 version as there are some issues with IE8 version.

Umamaheshwar Thota
  • 521
  • 3
  • 14
  • 32
0

try this, may this help you

it has solution for taking screen-shot.

http://stackoverflow.com/questions/3422262/take-a-screenshot-with-selenium-webdriver
bugCracker
  • 3,656
  • 9
  • 37
  • 58
  • Have seen this already. Sadly, Im facing issues only with IE 8 on Windows XP. All other browsers work fine. – Umang Jul 19 '13 at 13:21