Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

How to capturing screen shot of application under testing ?

View previous topic View next topic Go down

How to capturing screen shot of application under testing ?

Post by Adviser on Mon Aug 31, 2009 1:48 pm

hi,

In selenium you can get the screenshot of the current web page by the following 2 commands:

1. captureEntirePageScreenshot(filename, kwargs)

Arguments:

* filename - the path to the file to persist the screenshot as. No filename extension will be appended by default. Directories will not be created if they do not exist, and an exception will be thrown, possibly by native code.
* kwargs - a kwargs string that modifies the way the screenshot is captured. Example: "background=#CCFFDD" . Currently valid options:

background

the background CSS for the HTML document. This may be useful to set for capturing screenshots of less-than-ideal layouts, for example where absolute positioning causes the calculation of the canvas dimension to fail and a black background is exposed (possibly obscuring black text).

Saves the entire contents of the current window canvas to a PNG file. Contrast this with the captureScreenshot command, which captures the contents of the OS viewport (i.e. whatever is currently being displayed on the monitor), and is implemented in the RC only. Currently this only works in Firefox when running in chrome mode, and in IE non-HTA using the EXPERIMENTAL "Snapsie" utility. The Firefox implementation is mostly borrowed from the Screengrab! Firefox extension. Please see http://www.screengrab.org and http://snapsie.sourceforge.net/ for details.


2. captureEntirePageScreenshotAndWait(filename, kwargs)
Generated from captureEntirePageScreenshot(filename, kwargs)

Arguments:

* filename - the path to the file to persist the screenshot as. No filename extension will be appended by default. Directories will not be created if they do not exist, and an exception will be thrown, possibly by native code.
* kwargs - a kwargs string that modifies the way the screenshot is captured. Example: "background=#CCFFDD" . Currently valid options:

background
the background CSS for the HTML document. This may be useful to set for capturing screenshots of less-than-ideal layouts, for example where absolute positioning causes the calculation of the canvas dimension to fail and a black background is exposed (possibly obscuring black text).

Saves the entire contents of the current window canvas to a PNG file. Contrast this with the captureScreenshot command, which captures the contents of the OS viewport (i.e. whatever is currently being displayed on the monitor), and is implemented in the RC only. Currently this only works in Firefox when running in chrome mode, and in IE non-HTA using the EXPERIMENTAL "Snapsie" utility. The Firefox implementation is mostly borrowed from the Screengrab! Firefox extension. Please see http://www.screengrab.org and http://snapsie.sourceforge.net/ for details.

so, with the help of both command you can save your screenshot in specified location and verify it by clicking manually.

Best of luck.

bye

Adviser
------------------------
------------------------

Posts : 379
Join date : 2009-07-30
Location : India

http://seleniumforum.forumotion.net

Back to top Go down

Re: How to capturing screen shot of application under testing ?

Post by Adviser on Tue Sep 08, 2009 11:29 am

Sample example to be recorded on gooogle site.

New Test
openhttp://www.google.co.in/
typeqyahoo
clickAndWaitbtnG
captureEntirePageScreenshotc:\sceen.png

_________________
Spread Your Knowledge About Selenium Tool.

Administrator
Email: selenium.discussion.thread@live.com
Forum: http://seleniumforum.forumotion.net

Adviser
------------------------
------------------------

Posts : 379
Join date : 2009-07-30
Location : India

http://seleniumforum.forumotion.net

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum