Inizia ora la tua demo e risparmia sui primi 12 mesi!

Blog

Controlling Snapshots

Pubblicato da Il 16 Febbraio 2021 in Blog, Tips

Each time that a test action (e.g. click, select, etc…) or a verification (e.g. isEnabled, isEditable, etc…) is performed, Maveryx gets a Snapshot of the current application’s UI automatically and transparently to the user.
A Maveryx’s Snapshot is an XML file containing information and details that the Maveryx’s Viewer captured.

Sometime, you could have the need to test your application without taking Snapshot for every action or verification. Maybe because you need to save time and/or resources, or maybe because you don’t need to.

To get control of the Viewer component that captures snapshots you have to use the following instructions:

(1) MaveryxRuntimeConfiguration.setTakeSnapshot(false);

or

(2) MaveryxRuntimeConfiguration.setTakeSnapshot(true);

Each time that the instruction (1) is executed the framework gets a Snapshot of the current application’s UI and, until the instruction (2) is executed, no more Snapshots are taken.
After executing the instruction (2) the framework returns to the normal mode, getting automatically Snapshots for every action and verification.

For example:



This piece of code results in getting three times an AUT snapshot.

Instead, by using:


This piece of code results in getting only once the AUT snapshot.

This could result in a performance improvement in the execution of the tests.

And you? Did you know that you could do something like this with Maveryx?