Forum Discussion

flostandard's avatar
flostandard
New Contributor
10 years ago

Testing both format (XML and JSO)

Hello,

I need to test my REST service response in both XML and JSON format.
What is the easiest way ?

I thought I could reuse the same assertion but I've discovered that the XPath Match expression are different depending on the format:
XML :
person[1]

JSON:
declare namespace ns1='http://namq1d121.slacdev.ca/consumer-rs/v1/gimember/coverage';
ns1:Response[1]

Regards,

1 Reply

  • Hi,

    One way to accomplish this is to have two requests, one that returns xml and another that returns json. Then using SoapUI Pro 5.1.1 you can use the XPath assertion for the xml response and JsonPath assertion for the JSON response.