Snapshots for scripts
TruClient can generate snapshots of steps during replay of a script. This topic describes how to work with snapshots.
About snapshots
Snapshots can be captured of the browser window when a script is replayed.
The engine generates snapshots during replay according to the settings for snapshot generation. Each snapshot is taken before the step's action is implemented:
- You can configure snapshot generation for interactive replay in the Development window General settings > Interactive options tab. For details, see Interactive options.
- A script can also generate snapshots when replayed in VuGen (load mode replay), and when it is run in performance and load tests. The snapshot level is according to the specifications in the runtime settings (Runtime Settings > Other > General).
Snapshots are saved as saved as .png files in the subfolders under the results folder for the script.
Create snapshots on demand
You can add a Take snapshot step to your script wherever you want to create snapshots.
To create snapshots on demand:
-
Prerequisite: Make sure you select On error and on demand for the Replay snapshot generation setting.
For details, see Interactive options.
- Open the Development window Steps box.
- Open the Functions tab and drag the Take snapshot step to the required location in the script.
- In the added step, set whether or not the snapshot should be full page.
View snapshots in the Snapshot viewer
You can view snapshots from script replay in the Development window or in VuGen. The snapshots are displayed in the Snapshot viewer.
To view snapshots:
-
Click the Snapshot view button on the Development window Toolbar. The Snapshot viewer opens in the right pane.
-
Select the relevant options in the Snapshot viewer to view the snapshots you want, in the way you want:
UI Element Description Snapshot type Displays snapshots for the selected replay mode:
-
Interactive replay. Displays snapshots that were generated while replaying the script in the Development window.
-
Load mode replay. Displays snapshots that were generated while replaying the script in VuGen.
Use to start and stop a slide show of all snapshots for the current view. <Browser> Displays snapshots for the selected browser, if the script was replayed in more than one browser. <Iteration> Displays snapshots for the selected iteration. Relevant for interactive replay mode only.
-
-
Select a step in the Development window to view the corresponding snapshot, or browse through the snapshots using the navigation bar at the bottom of the Snapshot viewer.
See also: