How to assert if a particular value exist in the response using Script Assertion
I need to traverse through the list and reach an element based on required value. Before getting inside the loop to traverse, i want to make sure if that value exists in the response . How can i achieve this using Assert statement?
Re: How to assert if a particular value exist in the response using Script Assertion
Here's how I would do this:
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
// Fail if the response does not have the value
assert (messageExchange.responseContentAsXml.contains("Value to be checked"));
Click the Accept as Solution button if my answer has helped, and remember to give kudos where appropriate too!