Comparing Json Responses
Consider I have 3 products with some requirments like colour and price . Initially they are in order P1 : {c1:p1} , P2 : {c2:p2} and P3 : {c3:p3} (Captured response). But from the server they are coming in order P2 , P1 and P3. Is there any way to compare these two responses in diff tool by ignoring order change ?
Comments
-
The XML mode of Diff Tool has a mode to ignore element order. If the response is XML, you can simply use that mode in Diff Tool. If the response is not XML, you could convert it to XML using the XML Converter Tool and then use Diff Tool in XML mode.
0 -
Hi @jakubiak ,
Whatever you suggested is working fine , but still some times even though i convert that to xml and then trying to compare, I am still getting some order change (4 out of 10 times). Is there any chance to ignore that too ?
0 -
It's hard to say without knowing more about your document. You could consider using the XML Sort tool (https://docs.parasoft.com/display/SOAVIRT9107/XML+Sort) in between converting to XML and using the Diff Tool, which will give you more control for how to control the sort.
0