2

I searched alot on forums to find command for capturing everything displayed on the desktop (not just the browser window), but found that this is a bug or limitation. The questions I found were of 2 to 3 years old.

So, is this still a bug or we have got some solution now?

I am using this way but it only captures the browser window.

File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);


FileUtils.copyFile(scrFile, new File("c:\\Users\\rabia.asif\\Desktop\\"+time()+".png"));
2

It is NOT bug or limitation, it is so by design. Browser knows only what is displayed in its browser window. If you want a screenshot of the whole screen, you need to ask underlying operating system. Which obviously is system-dependent, so browsers (by design) don't do that. And it is not even good idea for browser be able to do anything in operating system: many very creative people would do very creative things with such tool, and results would not be happy. hackers paradise.

Maybe some VNC tools can be automated: they deal with whole screen and are aware of the operating system they run in.

0
0

Chrome itself does not support full page screenshots (as you discovered).

Possible solutions:

  1. Chrome screenshot extensions like Full Page Screenshot circumvent this restriction by scrolling, and then stitching together a full page screenshot.

  2. Some browser automation tools like iMacros (based on IE) or Kantu (based on Chromium) have commands to capture full page screenshots automatically.

  3. PhantomJS can do so as well: http://phantomjs.org/screen-capture.html

1
  • I will definitely look into these possible solutions. Thanks – Rabia Asif Mar 31 '17 at 7:43

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.