It is a typical situation when you need to update a baseline item used by a checkpoint in order for the checkpoint to pass. TestComplete allows updating the data of region checkpoints either at runtime or from the test log after the test run is over. This topic describes the mentioned approaches in detail.
Updating Checkpoints at Runtime
TestComplete lets you update the contents of elements stored in the Regions collection directly from your tests. This can be useful if you need to batch update many region checkpoints with actual data of your application under test.
The region checkpoint data update is supported by --
-
Region Checkpoint operation.
-
Compare Pictures operation.
-
Regions.RegionCheckpointName.Check scripting method.
-
Regions.Compare scripting method.
To enable the checkpoint data update, do the following:
-
Turn on the global update option:
-
Select Tools | Options from the TestComplete main menu. This will open the Options dialog.
-
Select the Engines | Stores category.
-
Select Update regions.
-
Click OK to close the dialog.
-
-
Select the checkpoints to update:
-
In the Project Explorer, double-click the Stores | Regions item. This will open the Regions editor.
-
Select the Update check box next to the checkpoints you want to update during the test run.
-
Select File | Save from the TestComplete main menu to save the changes.
-
When you run the test, selected checkpoints automatically replace stored images with actual images captured during the test run.
Note: | After you update needed checkpoints, remember to disable the global and per-checkpoint update options. |
Updating Checkpoints From the Test Log
When a region checkpoint fails, you can easily update its data from the Test Log panel. For this purpose, follow the steps below:
-
Select the message informing about the checkpoint failure in the test log.
-
Switch to the Details panel.
-
Click the Update the <Checkpoint_name> checkpoint data link at the bottom of the panel.
-
TestComplete will display a message asking whether you want to update the checkpoint. Click Yes in this message to close it and to update the baseline data used for the failed checkpoint. After that, TestComplete will replace the stored image with the corresponding image object. If you click No, TestComplete will close the message without updating the checkpoint.