How to mock the APIs and how is that helpful?

When and how to use Mock Servers and how to set up a Mock server in Postman?

Pricilla Bilavendran
3 min readApr 15, 2022

What is a Mock Server?

During your API Testing journey, you cannot wait every time for your API to be completely ready.

We might have the API documentation with the sample responses. So what do we? Using the sample response we can create mock APIs and that endpoint can be used for your testing purposes.

You might have heard the term “Mock servers”, it is nothing but a single base URL with multiple API endpoints configured to return the specified response every time. So every time you hit the specific endpoint, the same response is returned.

How is that helpful?

  1. We can analyze the response body and understand what is expected in the body
  2. We can start writing the assertions for our response body
  3. This helps to continue development even when an external service fails.
  4. This avoids data sharing and supports to test the endpoints individually.

To know more about Mock servers please check here.

How to create a “Mock Server” using Postman:

--

--