groovy - SoapUI Mock service groovey script to select right response -
i have mock service has operation 2 possible responses. how can select right response based on condition using scripting? eg.
if(context.sessionid == ''){ // use response 1 } else { // use response 2 }
if code in dispatch script of "mockresponses" correct syntax is:
return "response 1" [edit] well-explained in official web-site: http://www.soapui.org/service-mocking/creating-dynamic-mockservices.html#5-selecting-a-response-based-on-the-request
Comments
Post a Comment