Challenge - 5 Problems
API Testing Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate1:30remaining
What is the response status code of this GET request?
You send a GET request to https://jsonplaceholder.typicode.com/posts/1 using Postman. What is the expected HTTP status code in the response?
Postman
GET https://jsonplaceholder.typicode.com/posts/1Attempts:
2 left
💡 Hint
A successful GET request to a valid resource usually returns this status code.
✗ Incorrect
The endpoint returns a valid post, so the server responds with 200 OK status code.
❓ assertion
intermediate2:00remaining
Which assertion correctly verifies the response body contains userId 1?
You receive this JSON response body from the API: {"userId": 1, "id": 1, "title": "...", "body": "..."}. Which Postman test script assertion correctly checks that userId equals 1?
Postman
pm.test("User ID is 1", function () {
// assertion here
});Attempts:
2 left
💡 Hint
Check for exact equality of userId to 1.
✗ Incorrect
Option A correctly asserts that userId in the JSON response equals 1.
❓ locator
advanced1:30remaining
Which JSON path correctly locates the title in the response?
Given the JSON response: {"userId": 1, "id": 1, "title": "foo", "body": "bar"}, which JSON path expression correctly selects the title value?
Attempts:
2 left
💡 Hint
The title is a top-level key in the JSON object.
✗ Incorrect
The JSON path $.title selects the title key at the root level.
🔧 Debug
advanced2:00remaining
Why does this Postman test script fail?
Test script:
pm.test("Check status", () => {
pm.expect(pm.response.code).to.equal(200);
});
Why does this test always fail even if the response status is 200?
Postman
pm.test("Check status", () => { pm.expect(pm.response.code).to.equal(200); });
Attempts:
2 left
💡 Hint
Check the correct property name for response status code in Postman scripts.
✗ Incorrect
pm.response.code does not exist; the correct property is pm.response.status.
❓ framework
expert2:00remaining
Which Postman feature allows running tests automatically after each request?
You want to automate running your test scripts every time you send a request in Postman. Which feature should you use?
Attempts:
2 left
💡 Hint
Tests tab scripts run after the response is received.
✗ Incorrect
Scripts in the Tests tab run automatically after each request to validate the response.