XML Checkpoint Operation

Applies to TestComplete 15.69, last modified on November 13, 2024

Description

Use the XML Checkpoint operation to compare the contents of an XML document against a baseline copy that is stored in your project, or to update the baseline copy with XML data. The functioning mode of the operation is specified by the Update XML data setting (you can modify it in the Stores Options dialog). By default the setting is disabled, and the operation performs the comparison. If the setting is enabled, the operation updates the stored baseline copy.

The baseline data is stored as an XMLCheckpoint project element that belongs to the Stores | XML collection of your project. When you add the operation to your test, TestComplete displays the Checkpoint wizard, in which you specify the XML document to be checked and the XMLCheckpoint element to be used for the check. You can select an existing element or command TestComplete to create a new one. In the latter case, after you close the wizard, TestComplete will save the contents of the specified document to a new XMLCheckpoint element to the Stores | XML collection. If the operation works in comparison mode, TestComplete will compare the actual document contents with this saved data during the test execution. If the operation works in update mode, TestComplete will update the baseline copy with the information that is stored in the document.

Operation Result

In comparison mode, if the content of the XML document coincides with the saved baseline copy, the operation returns True and posts a checkpoint message () to the test log. Otherwise, the operation returns False and posts an error message () to the log.

In update mode the operation always returns True.

Scripting Analogue

The operation is analogue to the XMLCheckpoint.Check scripting method.

Child Operations

The operation cannot have child operations.

Operation Parameters

The operation uses the following parameters:

XMLCheckpoint element

Specifies the name of the XMLCheckpoint project element that stores the baseline copy of data to be used for comparison. The element’s name is shown in the Operation column of the Keyword Test editor. See below for information on how to specify another element.

xmlSource

Specifies the source of the compared XML data. It can be one of the following:

  • Fully qualified file name of the desired XML document.

  • URL of the desired XML document.

  • An expression or variable that is reference to the XMLCheckpoint object.

  • An expression or variable that is reference to an IXMLDOMDocument object (this is an object from Microsoft XML DOM. See the MSDN Library for more information).

  • An expression or variable that is reference to the WebService object.

When you add an operation to the keyword test, TestComplete displays the Checkpoint wizard, in which you can specify the XML document to be checked and the XMLCheckpoint element to be checked. These parameters can be modified any time after you added the operation to your keyword test. .

To specify another XMLCheckpoint element that will be used for the comparison or update
  • Select the operation in the Keyword Test editor.

  • Select the Operation cell.

  • Select the cell or press F2. This will activate the in-place editor.

  • Choose the desired XMLCheckpoint element from the drop-down list.

  • Press Enter to confirm the change and to close the editor, or press Esc to close the editor discarding any changes.

To specify another document to be checked
  1. Double-click the operation in the Keyword Test editor. TestComplete will call the XML Checkpoint wizard.

  2. In the wizard, select the needed document.

An alternative is to modify the xmlSource parameter of the operation via the Operation Parameters dialog:

  1. Select the needed operation in your keyword test.

  2. Click the Value cell twice (not double-click) or select the cell and press F2. This will activate the in-place editor.

  3. Click the ellipsis button of the in-place editor. TestComplete will open the Operation Parameters dialog.

  4. In the dialog, specify the operation parameters. For detailed information on how to work with the dialog, see Specifying Operation Parameters.

  5. Click OK to close the dialog and apply changes.

  6. Press Enter to confirm the changes and close the in-place editor, or press Esc to close the editor discarding any changes.

Remarks

By default, if the XML Checkpoint operation cannot find or access the XML document, the contents of which it verifies, it waits for the XML document for a period that the Playback > Auto-wait timeout property of your project specifies. If the XML document has not been found by the end of the period, the operation fails.

For information on creating and modifying XML checkpoints and on how the comparison procedure works, see topics of the About XML Checkpoints section.

See Also

Checkpoints Category
About XML Checkpoints
About XMLCheckpoint Element Editor
Modifying Elements of the XML Collection
Specifying Operation Parameters
Checking Operation Result

Highlight search results