Aaronliu
13 years agoFrequent Contributor
Operate Response
Dear All,
I have a test case, consist of two steps, step1 is a request, step2 is a groovy script.
I want to check some values return from reponse in step2. how to get the object of response to check?
now I only add script assertion in response to check these values.
example:
I have a test case, consist of two steps, step1 is a request, step2 is a groovy script.
I want to check some values return from reponse in step2. how to get the object of response to check?
now I only add script assertion in response to check these values.
example:
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
//get xmlHolder
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent )
//get namespace
responseHolder.namespaces['ns1']='http://www.webservicex.net';
def placeName=responseHolder.getNodeValue("count(//ns1:GetWeatherByPlaceNameResponse[1]/ns1:GetWeatherByPlaceNameResult[1]/ns1:Details[1]/ns1:WeatherData)")
assert placeName!=null