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 web comparison checkpoints at runtime, at design time from the Web Comparison Element editor or from the test log after the test run is over. This topic describes the mentioned approaches in detail.
Updating Checkpoints From the Web Comparison Element Editor
You can easily update web comparison checkpoints from the Web Comparison Element editor. To do this, follow the instructions below:
-
Make sure that the web page whose contents are verified by the checkpoint is currently opened in one of web browsers supported by TestComplete. For the list of supported browsers, see Supported Web Browsers and Technologies.
-
Open the Web Comparison element that stores data used by the checkpoint:
-
In the Project Explorer, expand the Stores | WebTesting node and locate the Web Comparison element that stores the data you want to update.
-
Double-click the desired Web Comparison element or right-click the corresponding element and choose Edit from the context menu.
-- or --
-
If you call the web comparison checkpoint from a keyword test, right-click the corresponding Web Comparison Checkpoint operation in the test and choose Edit Checkpoint Data from the context menu.
-
-
TestComplete will open the element in the Web Comparison Element editor. The editor displays the page’s source code that will be used for verification and the checkpoint settings.
-
To update the page’s source code, click Update at the top of the editor.
Updating Checkpoints at Runtime
TestComplete lets you update the contents of Web Comparison elements stored in the Web Testing collection directly from your tests.
Web Comparison element data update is supported by the following test operations:
-
The Web Comparison Checkpoint keyword test operation.
-
The
WebTesting.WebComparisonCheckpointName.Check
scripting method. -
The
WebTesting.WebComparisonCheckpointName.Compare
scripting method.
As a rule, these test operations are used to verify the contents of the web page under test by comparing it with the contents of the Web Comparison element, but they can also replace the contents of a stored element with those of the specified web page.
In order to make it possible, you should enable the Update WebTesting elements option:
-
Select Tools | Options from the TestComplete main menu. This will open the Options dialog.
-
Select the Engines | Stores category.
-
Select Update WebTesting elements.
-
Click OK to close the dialog.
After you run the test that contains any of the above-mentioned test operations, TestComplete will automatically replace the stored element with the contents of the relevant web page.
Updating Checkpoints From the Test Log
When a web comparison 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 top 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 Web Comparison element with the corresponding web page’s contents. Click No to close the message without updating the checkpoint.
See Also
Web Comparison Checkpoints
About Web Comparison Checkpoints
About WebTesting Collection
Modifying WebTesting Elements