Taking Screenshots¶
Taking screenshots during test playback can serve several purposes:
- To provide clues for test failure analysis.
- To document test execution, which may be required by company policy.
- To generate test documentation and even user guides.
Rapise can take screenshots automatically after every action or on-demand at specific points during test execution.
Automatic Screenshots¶
To enable automatic screenshots after every action, use the Screen Capture test settings.
Note: Automatic screenshots are supported for Desktop and Web applications, and are not supported for Mobile.
Screenshots in Framework Mode¶
The simplest way to enable screenshots is to use the Parameters...
section in the Choose Test Case
dialog:
Then, choose Capture Execution
:
Press OK, and set a value:
Taking a Screenshot when a Test Fails¶
By default, the option to take a screenshot whenever a test fails is enabled:
Playback¶
If you set the following in Screen Capture before execution:
Capture Cursor = True
Capture Execution = True
Widget Only = True
then, after playback, Rapise will generate the screen flow document.
A link to the document is also available in the report:
The content of the document looks like this:
Note: If an object is not available on screen after an action is performed on it, Rapise takes a screenshot of the entire desktop window. You can see this in step #5 above; the login button disappeared after it was clicked.
Note: Rapise also always takes an additional screenshot of the entire desktop window at the end of test execution, even if the test was terminated due to a failed assertion. See step #7 below.
Embed Screenshots Into Report¶
The execution screenshots described above are stored in the local file system. If a test report is uploaded to SpiraTest, these screenshots are not uploaded.
To embed screenshots into execution reports and make them available in SpiraTest, set the following:
Include in Report = True
in Screen Capture settings.
In Rapise, screenshots are embedded before each action:
Screenshots in SpiraTest:
Suppressing Screenshots¶
Sometimes, it makes sense to temporarily disable screenshot capturing. Learn how to do this:
On-Demand Screenshots¶
It is also possible to take screenshots at specific points during test execution. The method for doing this depends on the test target.
Desktop¶
This method works for both desktop and web applications running on the same machine as Rapise.
Use the global Tester object and its actions to take a screenshot of an object, a specific window, or the entire desktop.
Web¶
This method works well if you plan to run a web test on remote machines via Selenium WebDriver.
Use the global Navigator object and its Navigator.DoScreenshot action.
Mobile¶
To take a screenshot on a Mobile target, use:
Recording¶
If, before a recording session, you set the following in Screen Capture:
Capture Cursor = True
Capture Recording = True
Widget Only = True
then, after recording, Rapise will generate the screen flow HTML document.
with content like this:
Note: We recorded the
Login/Logout
scenario on the Library Information System sample application. See the web testing tutorial for more details.