How to capturing screen shot of application under testing ?
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
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
Re: How to capturing screen shot of application under testing ?
Tue Sep 08, 2009 11:29 am
Sample example to be recorded on gooogle site.
New Test | ||
open | http://www.google.co.in/ | |
type | q | yahoo |
clickAndWait | btnG | |
captureEntirePageScreenshot | c:\sceen.png |
- [Help] Problem of Using Selenium IDE Testing with SmartGWT Application
- How to take the screen shot? when i set a kwargs, it is showing error... when i not set kwargs it is coming black color as background
- How to recognise controls inside tabNavigator of Flex application while testing in Selenium.
- Using selenium for testing Mendix application, but cannot click a button that triggers a change on event.
- Problem testing a smartgwt application with Selenium2
Permissions in this forum:
You cannot reply to topics in this forum