Choose the best explanation for why testers use a mock server URL during API testing.
Think about why you might want to test an API before the real backend is finished.
Mock server URLs let testers simulate API responses so they can test frontend or integration without waiting for the real backend. This helps catch issues early.
Given this Postman mock server setup, what will be the response body when a GET request is sent to /user/123?
{
"mock": {
"endpoint": "/user/:id",
"method": "GET",
"response": {
"status": 200,
"body": {
"id": "123",
"name": "Alice",
"role": "tester"
}
}
}
}Look at the mock response body and the URL parameter substitution.
The mock server replaces the :id parameter with the actual value 123 and returns the defined response body with status 200.
You have a mock server with base URL https://mockserver.postman.com. Which full URL correctly calls the mock for endpoint /orders/:orderId/items with orderId 789?
Remember how URL path parameters are replaced in mock server URLs.
The :orderId placeholder is replaced by the actual value 789 in the URL path, so the correct URL is /orders/789/items.
In Postman test scripts, which code snippet correctly asserts that the response status code from the mock server is 200?
Check the correct Postman assertion syntax for status code.
Option B uses the correct Chai assertion syntax provided by Postman to check response status code.
Given this test script for a mock server response:
pm.test('Response has userId 101', () => {
pm.expect(pm.response.json().userId).to.eql(101);
});The mock server response body is {"userId": "101", "name": "Bob"}. Why does the test fail?
Check the data types of the expected and actual values in the assertion.
The mock server returns userId as a string "101" but the test expects the number 101. The strict equality check fails due to type mismatch.