Squish tip of the week: Capture screenshot on error or failure

Squish tip of the week: Capture screenshot on error or failure

Need a visual at the time of error or failure?

While script errors or verification point failures return information about the issue, a picture, in addition to data, may further clarify the reason for the issue.

Enabling testSettings.logScreenshotOnError or testSettings.logScreenshotOnFail fail in a script or a portion of a script captures a screenshot of the entire desktop at the time the script error or verification point failure occurs.

The script below contains both testSettings.logScreenshotOnError and testSettings.logScreenshotOnFail set to true. The verification point checks for a string in a particular object which does not match. The Test Results illustrate not only the value comparison failure, but also provide an interactive link to the screenshot captured at the time of error.

Sample Script

Sample Script

Test Results

click to view larger image

Screenshot Captured

logScreenshot_image

For more information related to screenshot logging see:

How to Create Automatic Screenshots on Test Failures and Errors