I have a situation where two different webservice methods should return exactly the same XML file.
Right now when I get those two responses I compare those XML files using XMLUnit framework which shows xpath location + differences in various nodes like in the following code:
XMLUnit.setIgnoreWhitespace(true);
DetailedDiff diff = new DetailedDiff(XMLUnit.compareXML(firstXML,secondXML));
List<Difference> allDiifferences= diff.getAllDifferences();
for(Difference difference : allDiifferences){
System.out.println(difference.getControlNodeDetail().getXpathLocation()+" ("+difference.getControlNodeDetail().getValue()+") /("+difference.getTestNodeDetail().getValue()+")");
}
When I am running the tests in SoapUI I use
log.info
log.error
methods to show the differences which are storred in XMLs.
Is there any better way to show those differences?