It is a typical situation when you need to update baseline data used by a checkpoint in order for the checkpoint to pass. TestComplete allows updating the data of XML 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 XML files stored in your project as XMLCheckpoint elements of the Stores | XML collection directly from your test.
The XMLCheckpoint element data update is supported by the following test operations:
-
The XML Checkpoint keyword test operation.
-
The
XML.XMLCheckpointName.Check
scripting method. -
The
XML.XMLCheckpointName.Compare
scripting method.
As a rule, these test operations are used to check XML document contents against data stored by the XMLCheckpoint element, but they can also replace the stored contents with the contents of the specified XML document instead of checking them.
To enable the XML checkpoint data update, turn on the Update XML data option:
-
Select Tools | Options from the TestComplete main menu. This will open the Options dialog.
-
Select the Engines | Stores category.
-
Select Update XML data.
-
Click OK to close the dialog.
Now, when you run a test containing any of the mentioned test operations, TestComplete will automatically replace data stored in the XMLCheckpoint element with data obtained from the specified XML document.
Updating Checkpoints From the Test Log
When an XML 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 link at the bottom of the panel.
-
TestComplete will display a message asking whether you want to update the checkpoint. Click Yes to update the baseline data used for the failed checkpoint. After that, TestComplete will replace the stored XML file with the corresponding file on the disk. Click No to close the message without updating the checkpoint.