7

I'm from Germany so excuse me for some bad sentences.

I've coded an web-based application, now I want to do a screenshot of the page in one part of the code.

I'm using HTML-Unit, so I want to know how I can do it with it, it would be bad if I needed to change this in the whole project.

Looking forward for an answer, sincerely, a guest

gouessej
  • 3,640
  • 3
  • 33
  • 67
aGuest
  • 71
  • 1
  • 2

1 Answers1

6

HtmlUnit never renders a page visually, so there's no image to capture.

There are tools like FireShot that do a good job of capturing web page images; perhaps there is one that can be accessed via an API, or perhaps you could script something up to interact with a browser.

Also see the accepted answer to How can I take fullscreen screenshot of website

Community
  • 1
  • 1
Rodney Gitzel
  • 2,652
  • 16
  • 23
  • Thanks man,i'll have a look at FireShot, i need to login to my webpage, is it possible with FireShot? – aGuest Jun 22 '11 at 11:53
  • 3
    but why phantomjs does support it ... ? – Ben Ishak Sep 19 '13 at 14:40
  • 1
    HtmlUnit provides its own GUI-less (for HTML as well as "Browser-Chrome") browser. Phantomjs is based on webkit, so it is a full browser other that the "Browser-Chrome". – Paddy Mar 17 '14 at 16:04
  • No possible. Check [this](https://code.google.com/p/selenium/issues/detail?id=1361) comment – user1079877 Jul 07 '14 at 02:46