Excluding XML Data From Verification

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

Sometimes you may need to exclude some data from XML verification. This may be needed, for example, if the application generates more information than you are interested in or if it generates XML documents that contain values changing from one document generation to another and you do not need to check these values. This topic explains how you can make TestComplete ignore some data in verified XML files.

You can exclude XML data from verification by deleting it from the XMLCheckpoint element that stores the baseline copy of the data to check. To do this, follow the steps below:

  • Open the XMLCheckpoint element storing the desired baseline data in the XMLCheckpoint Element editor.

  • In the Tree View page, delete XML document nodes that should be ignored during comparison.
  • Enable the Compare in subtree mode comparison setting.

TestComplete will check whether the nodes stored in the XMLCheckpoint element are included in the actual document (that is, stored nodes must form a subtree of the actual document's node tree) and then only check the values of those nodes. If a node exists only in the actual document, it is excluded from verification.

So, verification results do not include messages about nodes that exist only in the actual document and do not exist in the stored document.

Note: Sometimes, deleting the entire variable node is inadmissible. For example, the node's child nodes cannot be changed or some of the node's attributes can be variable. In this case, you can remove only the node's variable element, that is, an attribute or a #text subnode. However, this should be done both in the stored and in the actual XML data before verification.

See Also

XML Checkpoints
XML Checkpoints
Alternatives to XML Checkpoints

Highlight search results