Blurred screenshots with Selenium Webdriver



  • 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.

    Thanks



  • 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"));                   
    


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2