The Postman is a powerful tool that can be used as a mock server to create mock services that are accessible over both public and private networks. This makes it a very useful tool for creating mock services that can be used to test the UI and other components without having to wait for the actual service to be ready. By simulating the behaviour of a real service, Postman allows developers to test their code against a realistic environment, helping to identify potential issues before the service is deployed.
Setting Up a Postman Mock Server
- Install Postman on a VM or your own machine based on the use case using the link https://www.postman.com/downloads/.
- Open Postman.
- Click on the "..." button in the top right corner of the screen and select "Mock Server" from the drop-down menu.

- In the "Mock Server" window, select "Create a mock server" if you haven't created one yet.
- Choose the request that you want to use as a template for your mock server, and select the "Create" button.
- In the "Mock Server" window, choose a name for your mock server, and select the environment in which you want to run it.
- Under the "Behaviour" tab, select the responses that you want your mock server to return. You can choose to add specific responses, random responses, or even create custom scripts to generate responses.
- Under the "Examples" tab, you can add example responses to help you test your API request.
- Once you're done configuring your mock server, select the "Save" button to save your changes.
- You can then start your mock server by selecting the "Start" button in the "Mock Server" window.
Once your mock server is up and running, you can use it to test your API requests by sending them to the URL provided by the mock server. The responses you receive will be based on the behaviour you specified when you set up the mock server. This allows you to test your API requests without having to wait for the actual service to be ready.

Pavan RamamurthyPosted May 15, 2023, 6:47 AM
Explained well !