Forum Discussion

alowe's avatar
alowe
New Contributor
6 years ago

XML variable testing- does XML Comparison test the variables in it?

Hello- I have 2 XML files that I want to compare. I have set up a test with the XML checkpoint. This may be a stupid question but does the XML checkpoint actually check all of the variables in the original XML with the new XML and report if there are errors?

I see it reports errors for some of the data fields that the words or code doesn't match but I haven't got any errors on the data/variables in the XML it self...couldn't find a direct answer that gave me 100% confidence it was checking this.

 

Thanks!

3 Replies

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    These links may be of some help:

    https://support.smartbear.com/testcomplete/docs/testing-with/checkpoints/xml/analyzing-results.html

    https://support.smartbear.com/testcomplete/docs/testing-with/checkpoints/xml/analyzing-results.html

     

    If you don't think a particular test is working properly, please post the two xmls that you are comparing and post the results of the test, showing which part you think is wrong.  The more details you give us, the easier it is for us to help you.

     

    • alowe's avatar
      alowe
      New Contributor

      I have included a screen shot of the data I am asking about. Do the green boxes in the image get checked or just the red?

       

      Thank you!

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        https://support.smartbear.com/testcomplete/docs/testing-with/checkpoints/xml/how-comparison-works.html

         

        see section in italics below

         

         

        The checkpoint obtains the actual contents of the XML document and checks it against baseline data stored in the project's XMLCheckpoint element. To do this, TestComplete goes down the hierarchy of document elements and compares each element node. The check starts from the root nodes. For each node TestComplete performs the following actions:

        • Finds the appropriate node in the documents. Depending on the Ignore node order setting TestComplete may also check the node's position in the documents.

        • After the appropriate node is found, TestComplete compares the nodes' values.

        • Then, if the Ignore attributes is disabled, TestComplete compares the nodes' attributes and namespace declarations (the comparison of namespace declarations can be skipped by enabling the Ignore namespace declaration setting).

        • Then, TestComplete obtains the list of child nodes and continues the comparison with the child nodes.

        • If the compared nodes or their child nodes differ from each other, TestComplete reports the compared nodes as different.