tags:

views:

2529

answers:

3

I need to create a screenshot of the page by providing a page URL to the command line tool. I found the following application: Convert HTML To Image. This tool is OK but want a more flexible application. I need to have ability to perform the following:

  1. Go to the following page.
  2. Click button.
  3. Take a screenshot and save it.

I want to create an application that will test a site by going by URL, take a shots, and then send the images to the email.

Does anybody has an experience in solving such problems?

A: 

According to the WatiN features page:

  • Supports creating screenshots of webpages

I would direct you to more specifical documentation, but the documentation web doesn't work well with Firefox, so I can't search it.

Gonzalo Quero
+5  A: 

Watin can capture screenshots:

ie.CaptureWebPageToFile("c:\tmp\watin main page.jpg");

More info:

http://watin.sourceforge.net/releasenotes-1-2-0-4000.html http://fwdnug.com/blogs/ddodgen/archive/2008/06/19/watin-api-capturewebpagetofile.aspx

Brian
As of my research right now, this only works with IE7 - Firefox and other IE versions all have odd errors.
Robert P
+1  A: 

I am a contributor to the WatiN project and the author of the WatiN Test Recorder. To do what you want, I'd suggest using something like csExWB2 (http://code.google.com/p/csexwb2/). The demo will give you the basic browser, and you can add screen shots where you like. Emailing is not covered, but that should be fairly easy.