0
0
Postmantesting~10 mins

Using mock server URL in Postman - Test Execution Trace

Choose your learning style9 modes available
Test Overview

This test sends a GET request to a mock server URL in Postman and verifies that the response status code is 200, confirming the mock server is working correctly.

Test Code - Postman
Postman
pm.test("Status code is 200", function () {
    pm.response.to.have.status(200);
});
Execution Trace - 5 Steps
StepActionSystem StateAssertionResult
1Test startsPostman app is open with the mock server request loaded-PASS
2Send GET request to mock server URLRequest sent to mock server endpoint-PASS
3Receive response from mock serverResponse received with status code 200 and mock data body-PASS
4Run test script to check status codeTest script executed in Postman test tabVerify response status code is 200PASS
5Test ends with PASSTest result shows status code 200 assertion passedpm.response.to.have.status(200) passedPASS
Failure Scenario
Failing Condition: Mock server URL is incorrect or mock server is not running
Execution Trace Quiz - 3 Questions
Test your understanding
What does the test verify in this Postman mock server test?
ARequest method is POST
BResponse body contains user data
CResponse status code is 200
DResponse time is less than 1 second
Key Result
Always verify the mock server URL and ensure the mock server is active before running tests to avoid false failures.