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
    Aug 25 '14 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. Aug 25 '14 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
    Aug 25 '14 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. Aug 25 '14 at 12:14
  • 1
    There's another question with what looks like precisely the same problem: sqa.stackexchange.com/questions/10449/… Jul 1 '15 at 10:12

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, privacy policy and cookie policy

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