Forum Discussion
SmartBear_Suppo
11 years agoSmartBear Alumni (Retired)
Hi,
I believe the XPath assertion has limitations in respect to handling the null responses.
I suggest you use a script assertion. Attached is a project that mimics the JDBC response with a Properties TestStep and compares it with a response from a MockService. The responses are identical except that second to last node of the JDBC response is empty. In the TestCase, there is a request to the MockService and that step has the Script Assertion. Both responses are parsed into an XmlSlurper each that are used to do the assertion. I think you should be able to apply that solution to your project.
Regards,
Giscard
SmartBear Support
I believe the XPath assertion has limitations in respect to handling the null responses.
I suggest you use a script assertion. Attached is a project that mimics the JDBC response with a Properties TestStep and compares it with a response from a MockService. The responses are identical except that second to last node of the JDBC response is empty. In the TestCase, there is a request to the MockService and that step has the Script Assertion. Both responses are parsed into an XmlSlurper each that are used to do the assertion. I think you should be able to apply that solution to your project.
Regards,
Giscard
SmartBear Support
Related Content
- 7 years ago
Recent Discussions
- 18 hours ago
- 17 days ago