15 years ago
[soapUI] retrieve response in a groovy script
Hi all,
I'm new at using soapUI and I'm trying to retrieve response in a groovy script.
I'm using soapui 3.5.1 the open source version and I'm builing a test case about a web service exposed by our application server.
I need to check if the response contains a given section.
I created a test case with 3 steps:
A) a groovy script for setting in a dynamic way some properties before invoking the web service
B) a test request
C) a groovy script for checking the response
My code in step C):
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context);
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent);
responseHolder.namespaces["ser"] = ...;
String mySection = responseHolder["//ser:return"] ;
println mySection
but when I run my test case I got:
16:51:00,587 ERROR [SoapUI] An error occured [No such property: messageExchange for class: Script1], see error log for details
How should I retrieve the response ?
Thanks in advance
ferp
I'm new at using soapUI and I'm trying to retrieve response in a groovy script.
I'm using soapui 3.5.1 the open source version and I'm builing a test case about a web service exposed by our application server.
I need to check if the response contains a given section.
I created a test case with 3 steps:
A) a groovy script for setting in a dynamic way some properties before invoking the web service
B) a test request
C) a groovy script for checking the response
My code in step C):
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context);
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent);
responseHolder.namespaces["ser"] = ...;
String mySection = responseHolder["//ser:return"] ;
println mySection
but when I run my test case I got:
16:51:00,587 ERROR [SoapUI] An error occured [No such property: messageExchange for class: Script1], see error log for details
How should I retrieve the response ?
Thanks in advance
ferp