Please refer to the link to see what kind if screenshots I get - http://goo.gl/uDIyf3 instead of http://goo.gl/BQy1hI .

Not sure what could be wrong here as the same code has been working for me on other machines. The only possibility that I see is an issue with the configuration on the machine but can't find what that issue is.

The same scripts when ran in IE, it renders the correct screenshot, so it could be a chrome specific issue. Have uninstalled & reinstalled chrome but still the same.

I am using Selenium 2.28.0 version.

Please let me know if anyone needs more inputs my issue. Any hint to resolve this would be really helpful.


  • This is really odd and an interesting problem. Please provide the machine specifics for each as well as the rendered html of each image on the different machines.
    – mutt
    Commented Aug 25, 2014 at 11:14
  • @mutt - the machine is a 64-bit win 7. The good & bad screenshots are mentioned in the question posted. Also on the same machine the screenshots work on IE browser. Commented Aug 25, 2014 at 11:30
  • ok, mine works beautifully. I do see some foreign characters. What country are you access google from? I think it might have to do with your particular language version of google chrome and not the chrome in general...
    – mutt
    Commented Aug 25, 2014 at 12:02
  • @mutt those are not foreign chars, its the same screenshot with a mirrored image. In my case as well, it has een working well on other machines. Commented Aug 25, 2014 at 12:14
  • 1
    There's another question with what looks like precisely the same problem: sqa.stackexchange.com/questions/10449/… Commented Jul 1, 2015 at 10:12

2 Answers 2


First you need to update your selenium jar file and then try this code, i hope this code works.

File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); 
// Now you can do whatever you need to do with it, for example copy somewhere 
FileUtils.copyFile(scrFile, new File("C:\\eclipse\\scrennshot\\screenshot.png"));                   

How do you capture a screenshot using WebDriver or custom screenshoter ? May be the reason is in bad algorithm of getting screenshots after the test failures. Also you can try to update WebDriver to the newest version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.