Sunday, July 21, 2019

Web service mocking SoapUI

This next SoapUI tutorial for beginners is on web service mocking in Soap UI tool. Web service mocking is a useful feature in SoapUI automation testing. 

What is web service mocking? When a web service is being developed, you have to wait for it to be complete before you can test its' clients. In SoapUI tool, you can start software testing even before the web service is live. How? You can simulate a web service using a mock service. This mock service can be run by SoapUI. You can send requests and get predefined responses from the web service. If you want to see examples of mocking service SoapUI, view my tutorial on Web service mocking Soap UI or read on...

SOAP Mock Service 

In SoapUI, right-click any SOAP interface in the project. Click Generate SOAP Mock Service. You can name your mock web service. 

In the mock service editor, you can see the responses. You can double-click any response to open the response editor. In the response, you can replace ? with any predefined value. Next, you need to create a request for this response. You can click Opens/ Creates a Request for this MockResponse with correct endpoint button to create a request. In the request, replace ? with another predefined value. 

If you want to use the SOAP mock service, you have to run it. You can click the green arrow icon to run the mock service. Now, when you submit your request, your mock service will send you the predefined response.

Mock service SoapUI REST

How to create REST mock service in SoapUI? You need to create the SoapUI mock REST service, its' actions and responses. You can right-click the SoapUI project and click New REST MockService. You can name your mock REST service. Then add action with resource path. Then add a response to your action. 

Want to see examples? My SoapUI Beginner Tutorial shows SoapUI REST mock service example.

For good command in SoapUI test automation, you can view my full set of SoapUI testing tutorials.

No comments:

Post a Comment