Mocking Server Response Data with Postman on Android
Here is an easy way to test your application in every scenario using Postman Mock Server
As a mobile developer, we have to handle every response from the server to make sure our beautiful applications work properly.
To test every response from the server, we often have to mock data directly from our project locally -- this consumes a lot of time considering we also have to change our data as the server changes responses. If we have Android, iOS, and Web this task will be tripled.
With Postman Mock Server, you can test the application easily and you don’t have to ask the backend team to customize the response for every possible test case while you wait a few hours for QA (T_T). Test iterations are shorter and test quality is higher! \0/
Once you have your mock server you can focus on UI regression testing.
In this article I will show you how to use Postman as a mock server where you can easily change the response so that you can consistently test the UI.
Postman is a collaboration platform for API development. Postman’s features simplify each step of building an API and streamline collaboration so you can create better APIs — faster. www.postman.com
How to create a Mocking server using Postman?
I assume you already download and signed in, if not, you can download Postman here
Create a new mock server by clicking on New at the left top and choose Mock Server
2. Add the /repositories path and Response Body “Mock body sample”
3. Name your new mock server!
4. Create the mock server. You will see your mock URL like this.
5. Expand the “Github Mock Server” collection to see your API request and don’t forget to change your environment to “Github Mock Server” at the top right and try to call your mock server by clicking send. Boom!!!!
Congratulations! you have your own Mock server!!!
Time to put some magic into your mock server!
From here you can change your response in this sample project. We will add this response data to our mock server