cancel
Showing results for 
Search instead for 
Did you mean: 

Check whether Mock response exists

Highlighted
New Contributor

Check whether Mock response exists

In a Mock Service operation the return statement identifies which Response is to be sent.
return "Transaction Not Supported"

If the value is held in a variable
def tran = ....

How can I check that the response identified in "tran" exists before attempting to send it?

Thanks
Steve
3 REPLIES 3
Highlighted
Community Hero

Re: Check whether Mock response exists

Would you provide little more details of the problem? You mean to say you want to send the response using groovy script? Can you use like this? def trans = '''some foo more foo then bar''' if (trans) { return trans } else { return 'bar' }


Regards,
Rao.
Highlighted
New Contributor

Re: Check whether Mock response exists

Thanks Rao

 

I have a groovy script to choose the mock service response as per this article:

http://www.soapui.org/soap-mocking/creating-dynamic-mockservices.html

and using the method in "5. Selecting the Response based on the request"

 

Using:

return "Simple Response"

 

I want to check whether "Simple Response" exists as a mock response in this mock service.

 

Thanks

Steve

  

 

Highlighted
Community Hero

Re: Check whether Mock response exists

Is it possible to post your code?


Regards,
Rao.
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors