Ask a Question

How to insert a REST Mock Response in my Test Case

nemesdaniela
New Contributor

How to insert a REST Mock Response in my Test Case

How can I make a REST Mock Response test step?
There is only SOAP Mock Response Test Step option. Why is the REST option not available?

I am using SoapUI 5.6.0.

Any tips?

nemesdaniela_0-1623313323418.png

 

3 REPLIES 3
nmrao
Community Hero

Re: How to insert a REST Mock Response in my Test Case

@nemesdaniela 

 

Not sure if such step is available.

However one can create a mock service and send response from there as shown in the below video, please if that helps

https://www.youtube.com/watch?v=L2SMZ9bbDvE



Regards,
Rao.
This video will explain how can create mock REST service and also how can produce the dynamic response. (basic)
nemesdaniela
New Contributor

Re: How to insert a REST Mock Response in my Test Case

Thank you for your prompt response,  . I really appreciate your input.

It is a good option for those who want to mock the entire service or maybe I am missing something. I really need to add only 2-3 mock responses in my current project to mock a different service that we send/receive responses and that is not under our control.

 

So my project includes several services that we manage and we are working on integrating it with a different service that is not under our control. So I want to have 1 mock service with 2-3 mocked requests/responses to simulate the integration with that different project.

 

And I want to include that mock part into test suites and test cases for the integration simulation part (so a combination of our service and their mocked service). Any idea that I thought about on how to call that specific mock service response from my test suite did not work.

 

I don't see how they have omitted that option entirely since more and more projects are using REST services :(.

In any case, if someone has an idea on how to call a mock REST response into a test suite/test case please share this with us.

Maybe I need to look a bit more into groovy scripting and maybe this can be done that way.

 

Thanks again for your help.

nmrao
Community Hero

Re: How to insert a REST Mock Response in my Test Case

Your screen shot is the first time I see such step. Earlier, even for SOAP, people have to use mock service if they need create the tests while actual service is in development which is main purpose of mock services.
In the mock services, one can use simple static response or dynamic response (which needs more groovy scripting for this)

One can run the mock services before running the tests, so that mock services will provide the response for the test requests. But it (starting mock services) needs to be done automatic start, then needs search further, am sure someone might have already done that.


Regards,
Rao.
cancel
Showing results for 
Search instead for 
Did you mean: