Squish tip of the week: How to automatically update screenshot verification points

Squish tip of the week: How to automatically update screenshot verification points
Did you know that Squish supports an easy way to deal with screenshot verification points when there are significant changes in the appearance of applications?

As it is quite common that GUI’s of applications change with new releases, features and enhancements, it would be a real pain to retake all screenshots manually.

The solution to this problem is to automatically update all screenshot verification points with one single command (assuming bash shell):

export SQUISH_LEARN_SCREENSHOTS=1

Setting this variable tells squishrunner to update all the screenshots used in screenshot verification points.

How to automatically update screenshot verification points

Example for Windows: After pressing Win+R and executing “cmd” the command prompt will open, type:

set SQUISH_LEARN_SCREENSHOTS=1 *enter*
“C:Program Files (x86)\froglogic\squish-6.0.3-windows\squishide.exe” *enter*

Now execute all the tests with screenshot verification points – Squish will retake all the screenshots in the test scripts.

Once it is done, quit Squish and start it again without the set variable above. Squish will now compare screenshot verification points with updated screenshots.

Related topics

4 Comments

  1. Tobias Geyer 4 years ago

    Thank you for this article.

    However I’m trying to come up with a good reason to actually do this.
    As a tester, I would want to check each screenshot verification manually to make sure that the current screenshot actually is correct.
    I would also want to detect all cases where a screenshot should have changed, but didn’t.
    I’m never going to catch those cases with this approach.

    Then again I can use the regular test result log to manually compare and update the screenshots.

    Does anybody feel that using this feature is a good idea? Why?

    All the best
    Tobias

  2. Harri Porten 4 years ago

    Tobias, you are right: a mass-update of expected screenshots has its risks and needs to be employed with special care.

    This feature was added based on requests filed by several customers. For cases where a change of target platforms or UI styling (colors, margins) had an overly significant impact on the rendering. Up to a main where a start from scratch (reset all expected results, re-validate afterwards) was deemed to be less painful.

    Others may have gone for validating an exemplaric set of screenshots (to confirm an expected change pattern) before overwriting the rest of the set.

  3. Aaron 3 years ago

    does this work on linux with v6.2.0 – it doesn’t for me! The VPs remain as they were before.

    • Roberto 3 years ago

      Aaron, on Linux the way how environment variables are set is a bit different. And how exactly depends on the used shell. Something like “export SQUISH_LEARN_SCREENSHOTS=1” might work instead. If it doesn’t feel free to contact Squish support.

Leave a reply

Your email address will not be published. Required fields are marked *

*