XMLCheckpoint Element Editor - Comparison Settings

Applies to TestComplete 14.70, last modified on April 22, 2021

The XMLCheckpoint Element editor contains XML data stored in the XML collection for comparison purposes and settings that affect the comparison. To specify comparison settings, use the following check boxes at the top of the editor:

  • Ignore node order - If this check box is selected, TestComplete will ignore the order of elements in the baseline and actual documents. That is, these documents will be treated as equal if they differ only in the order or elements.

  • Ignore attributes - If this check box is selected, TestComplete will ignore attributes during comparison. That is, TestComplete will only compare the element names and values. For instance, the following elements will be considered as equal (ignored parts are marked with blue):

    <myElement xmlns:ns1="http://www.mycompany.com/tmpl/ns1" attr1="1" attr2="card">Some value</myElement>

    <myElement>Some value</myElement>

  • Ignore namespace declarations - If this check box is selected, TestComplete will ignore namespace declarations during comparison. For instance, the following two elements will be treated as equal (the ignored part is marked with blue):

    <myElement xmlns:ns1="http://www.mycompany.com/tmpl/ns1">Some value</myElement>

    <myElement>Some value</myElement>

    Note that TestComplete will only ignore namespace declarations. Other attributes will not be ignored.

  • Ignore prefixes - If this check box is selected, TestComplete will ignore the element’s prefixes when comparing. For instance, it will consider the following elements equal, because they have the same namespace URI, uri1 (the ignored parts of the elements are marked with blue):

    <RootNode xmlns:ns1="uri1">
      <ns1:myElement>Some value</ns1:myElement>
    </RootNode>

    <RootNode xmlns="uri1">
      <myElement>Some value</myElement>
    </RootNode>

    Note that the following elements will not be considered equal, because they have different namespace URIs. The first example defines a namespace with the uri1 URI and the same default namespace for the elements. In the second example, no namespace URI is specified, so it is empty:

    <RootNode xmlns="uri1" xmlns:ns1="uri1">
      <ns1:myElement>Some value</ns1:myElement>
    </RootNode>

    <RootNode>
      <myElement>Some value</myElement>
    </RootNode>

  • Compare in subtree mode - If this check box is selected, TestComplete will check whether the stored nodes are included in the actual document (that is, stored nodes must form a subtree of the actual document’s nodes tree) and then will only compare the values of these nodes. If a node only exists in the actual document, it is excluded from the comparison. So, if this option is active, the comparison results do not include messages about nodes that only exist in the actual document and do not exist in the stored document.

    Applications may generate XML documents that contain values that change from one document generation to another, for example, date and time of the generation, the name of the user who generated the document and so on. Using the Compare in subtree node option you can exclude such variable values from comparison. The receipt is very simple: after you save XML data to the XMLCheckpoint element, you use the element’s editor to delete variable nodes from the stored XML data. Then you select the Compare in subtree mode check box, so TestComplete will compare only those nodes that are present in the stored document. For more information, see Excluding XML Data From Verification.

  • Extended logging - If this check box is selected, the TestComplete report that was generated during the comparison will include information about unchanged nodes of the compared documents. That is, if the nodes of the stored and actual documents are equal they are included into the report as well as information on the differences.

See Also

About XMLCheckpoint Element Editor

Highlight search results