AnsweredAssumed Answered

How to validate multiple XML transformation/mapping?

Question asked by GoT on Mar 11, 2017
Latest reply on Mar 14, 2017 by Joel NeSmith

I've to validate the mapping for the XMLs transformed at multiple points. Currently, I'm filtering all the XML values and putting assertion one by one.


For example :

<intialTag>dataRemainsSame</intialTag>  --->  <finalTag>dataRemainsSame</finalTag>

So I filter the value of intialTag and finalTag, put an assertion {intialTag == finalTag} and everything works fine.


However, this becomes a very painful and tedious task since the generated XML has more than 70 fields each. So, is there a better way in which this particular case can be handled? 


Is it possible that we define the mapping in excel and DevTest reads it; and checks if everything is mapped correctly.


Secondly, how to handle cases when some of the optional fields (as defined in the XSD :: minOccurs=0) are not coming in the input XML (it becomes null to null map as the assertions are still defined in the test step)?



Also, filtering the value from XML is easy but I believe it will come handy if we have something that extracts the data from all the fields in the XML and store it in respective properties (with same name as in DOM with some prefix or suffix)