JHoreczky
13 years agoContributor
Combination of XML and Directory Datasources and Assertion
Thinking about using a combination of Directory and XML based DataSources combined with Assertion Steps for implementing response verification.
Set of canned SOAP responses reside in individual files in a specific directory. In the Assertion Step would need to read in the proper XML file matching the response that contains a saved version of the expected response. Use XPath for fetching elements both from the response and the expected response. Do assertion on the fetched values.
What API is available in Groovy for scripting XPath statements in the Assertion step? We cannot use generated static XPath assertions as the response is not entirely static in term of the number of elements returned, so we need to use some logic for dynamically constructing the XPath statements on the response in order to process the structurally different responses.
The approach described at http://blog.smartbear.com/software-qual ... -in-soapUI is useful, however it doesn't meet two critical pieces of our requirements:
1) The expected responses reside in individual XML files in a specific directory. 2) Structurally the XML document sent back in the response can vary in term of the elements it contains, thus the XPath assertions must be dynamically generated based on what elements are available in the response.
What would be the best option in SoapUI for implementing the above?
Thanks,
Joseph H.
Set of canned SOAP responses reside in individual files in a specific directory. In the Assertion Step would need to read in the proper XML file matching the response that contains a saved version of the expected response. Use XPath for fetching elements both from the response and the expected response. Do assertion on the fetched values.
What API is available in Groovy for scripting XPath statements in the Assertion step? We cannot use generated static XPath assertions as the response is not entirely static in term of the number of elements returned, so we need to use some logic for dynamically constructing the XPath statements on the response in order to process the structurally different responses.
The approach described at http://blog.smartbear.com/software-qual ... -in-soapUI is useful, however it doesn't meet two critical pieces of our requirements:
1) The expected responses reside in individual XML files in a specific directory. 2) Structurally the XML document sent back in the response can vary in term of the elements it contains, thus the XPath assertions must be dynamically generated based on what elements are available in the response.
What would be the best option in SoapUI for implementing the above?
Thanks,
Joseph H.