Forum Discussion

Raju_Vusirikala's avatar
Raju_Vusirikala
Contributor
16 years ago

Not able to do assertion for xml responase with JDBC Response

Hi,

I have created soap request step that is request1.xml which gives response1.xml.

I have created a JDBC Request, which is giving results from databse as an xml.

Now I want to do assertion with response1.xml and jdbcresponse.xml.

In this step I am able to select node from the xpath expression(//Results[1]/ResultSet[1]/Row[1]/TP_CUSTOMER_ID[1]) but not able to select node that i want in the Expected Results.
I am able to go upto this path  (${CCAddCustomerRequest#Response#//ns1:APIResponse[1]/response[1]})  but i want to select a node which in the response/body/id

How could i access child node structre?

Please find the attached screen shots.


Regards,
Raju.

1 Reply

  • Hi!

    this isn't a bug, the problem is that the soap response contains a nested XML message inside the actual XML response, and you are trying to use xpath to query into this (string) value. You can work around this though by adding a property-transfer teststep after your soap-request (and before the jdbc request) that transfer the nested response XML to a property in your testcase, then you can use that property as the source for the assertion, in which case it will be handled as a standard XML string and you should be able to use xpath to select inside its content..

    makes sense? let us know if not!

    regards,

    /Ole
    eviware.com