Forum Discussion
15 years ago
Hello all,
I have similar issue and i've scratched my head to find a solution. Here is the scenario :
i have REST request which returns json content in my test case, and i need to make some assertions on the result. As i usually do in a SOAP response, i wrote some xpath assertions like the following :
but the problem is that the namespace of the xml generated by "ResponseAsXML" depends on the url endpoint of the service i call. So if switch to another endpoint, all of the assertions on my test fail because all of the xpath points to nothing.
Do you guys have ideas how to work around this ? Is there a way to get rid of the namespace in the "ResponseAsXML" of a json response ?
Thanks in advance,
HR
I have similar issue and i've scratched my head to find a solution. Here is the scenario :
i have REST request which returns json content in my test case, and i need to make some assertions on the result. As i usually do in a SOAP response, i wrote some xpath assertions like the following :
declare namespace ns="http://localhost/mycontext/user"
//ns:Response/ns:userInfo/ns:address/ns:address
but the problem is that the namespace of the xml generated by "ResponseAsXML" depends on the url endpoint of the service i call. So if switch to another endpoint, all of the assertions on my test fail because all of the xpath points to nothing.
Do you guys have ideas how to work around this ? Is there a way to get rid of the namespace in the "ResponseAsXML" of a json response ?
Thanks in advance,
HR