Verify GET request with path parameters returns correct user data
Preconditions (2)
✅ Expected Result: Response status code is 200 and response body contains user data for userId 123
pm.test('Status code is 200', function () { pm.response.to.have.status(200); }); pm.test('Response has correct userId', function () { const jsonData = pm.response.json(); pm.expect(jsonData.userId).to.eql(123); });
The first test checks that the HTTP response status code is 200, which means the request was successful.
The second test parses the JSON response body and verifies that the userId field equals 123, matching the path parameter used in the request URL.
This ensures the API returns the correct user data for the given path parameter.
Now add data-driven testing with 3 different userIds: 101, 202, and 303
https://api.example.com/users/{userId}/posts/{postId} and path parameters userId=42 and postId=7, what is the final URL sent by Postman?https://api.example.com/items/{itemId} in Postman but forgot to set the path parameter itemId. What will happen when you send the request?/orders/{orderId}/items/{itemId} in Postman. You have a list of order IDs and item IDs. Which approach correctly tests all combinations using path parameters?Pass the test and this pattern moves unknown