Forum Discussion

ct_biji's avatar
ct_biji
Occasional Contributor
15 years ago

Xml Comparision

I need to compare two xmls each stored in different locations should i store it into the stores before comparing it?

Is there a way in test complete to compare xmls from their respective paths itself i need to compare these xmls even for a smaallest of change".

I had written script using vbscript for this comparision i wanted to know is there any other way?

Thanks

Doyel

1 Reply

  • Hello Doyel,

    I'd recommend that you use XML Checkpoints for this purpose. They are specially designed to compare XML-files, and they have a number of comparison-tuning options.

    By default, an XML Checkpoint keeps the baseline copy in the Stores collection, however, you may reload it from the original location before the comparison:





    ' Load data from MyFile1.xml to MyXMLCheckpoint

    Call XML.MyXMLCheckpoint.Document.load("C:\MyFolder1\MyFile1.xml")

    ' Compare the loaded data against MyFile2.xml

    Call XML.MyXMLCheckpoint.Check("C:\MyFolder2\MyFile2.xml")



    See Using XMLCheckpoint Elements to Verify XML Documents for more details.



    Happy automation.