Forum Discussion

mcaboor's avatar
mcaboor
Occasional Contributor
14 years ago

Compare the result of two differents requests in a testcase

Hi,
I work on a project about domain names.
I want to test a web service which return all informations concerning a Web Redirections of one domain name.
I already have a web service which give all information concerning a domain name including the web redirections. So i just have to lunch this web service ans the new one i wanted to test and to compare the response.

But..

I do not manage to make an easy Xpath assertion.

I try something like that:

Xpath expression
declare namespace ns2='http://adv.ws.mon.projet.com/';
//ns2:getWebRedirectsResponse[1]

Expected Result
${getDomainInformations#Response#declare namespace ns2='http://adv.ws.mon.projet.com/'; //ns2:getDomainInformationsResponse[1]/return[1]/webRedirects[1]}

the getWebRedirectsResponse and getDomainInformationsResponse[1]/return[1]/webRedirects[1]} contains the same data.

I've got the response
XPathContains assertion failed for path [declare namespace ns2='http://adv.ws.mon.projet.com/'; //ns2:getWebRedirectsResponse[1]] : Exception:org.custommonkey.xmlunit.Diff [different] Expected namespace URI 'null' but was 'http://adv.ws.mon.projet.com/' - comparing at /webRedirects[1] to at /getWebRedirectsResponse[1]

How can i fix this simply without making an XPath assertion for each data?
  • Hi,

    hmm... strange error.. can you show the actual two messages that you are comparing?

    regards,

    /Ole
    SmartBear Stockholm