Validate REST in XML response format with DB Values
I have used the XML Assertor to validate the XML response and DB Values. I have used JSON assertor to validate the JSON and DB Values.
For few of the fields in DB has null values and JSON response has empty. For which i have edited the element in configuration with replace(/root/item/element_name/text(),"null","").
But in XML response, for the fields that has null values in DB, the node is not present in XML.
The values are always dynamic. How to achieve this to validate between XML response and DB values?
Comments
-
Any help is appreciated
0 -
I would consider transforming the DB tool's XML output and/or the XML response into a common structure. If both XML documents are structured the same then they can be more easily compared. You can modify documents using a script in an Extension tool or with an XSL in an XSLT tool, for example. In this particular case, it sounds like you either want to strip out the null values from the DB tool output or inject absent values into the XML response.
0