Skip to main content

Squish tip of the week: Screenshot Verification Point

The most commonly used verifications in Squish are object property verifications - comparing the object properties values with an expected value. Those verification points can easily be inserted into a test script using the Squish IDE's point & click interface. This method is sufficient and for most scenarios best practise.

Nevertheless, sometimes it can be useful to have an additional screenshot verification point in place to be able to compare visually how an image (or logo) appears with an expected outcome or image.

How to add a Screenshot Verification Point

We need to provide Squish with an image/screenshot that shows the "original" image which will later be used for the comparison.

This can either be done by inserting a screenshot verification point during recording or by adding a breakpoint and using the picker tool.

Adding a screenshot verification point during recording Click image to see animation

Drawbacks and Solutions with Screenshot Verification

As screenshot verifications work by comparing pixels, this can sometimes lead to incorrect verifications. For example, if tests are run on a machine that is different from the one on which the original screenshot was taken or when used on different operating systems and different screen resolutions.

Even if tests are run on the same machine, there can sometimes be changes in settings, fonts or themes and the screenshot will differ from its original version. However, if we are careful about these issues, there are circumstances where screenshot verifications make sense and with the advanced settings capability in Squish there are ways to avoid these discrepancies.

For more information, please see the Screenshot Verification Point dialog section in our documentation.

In which cases are you using screenshot verification points?

Related topics

Comments

    The Qt Company acquired froglogic GmbH in order to bring the functionality of their market-leading automated testing suite of tools to our comprehensive quality assurance offering.