0
0
Postmantesting~10 mins

Why monitoring ensures API health in Postman - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to send a GET request to check API status.

Postman
pm.sendRequest({ url: '[1]', method: 'GET' }, function (err, res) { pm.expect(res).to.have.status(200); });
Drag options to blanks, or click blank then click option'
Ahttps://api.example.com/status
Bapi.example.com/status
Chttps://api.example.com
DGET https://api.example.com/status
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting https:// causes request failure
Using method name inside URL
2fill in blank
medium

Complete the code to check if the API response time is less than 200ms.

Postman
pm.test('Response time is acceptable', function () { pm.expect(pm.response.responseTime).to.be.[1](200); });
Drag options to blanks, or click blank then click option'
Aequal
BgreaterThan
Cbelow
Dabove
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'above' checks for greater than
Using 'equal' checks for exact match
3fill in blank
hard

Fix the error in the test that checks if the response body contains the key 'status'.

Postman
pm.test('Response has status key', function () { pm.expect(pm.response.json()).to.have.[1]('status'); });
Drag options to blanks, or click blank then click option'
AhaveKey
Binclude
Ccontain
Dproperty
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'contain' or 'include' works for strings or arrays, not object keys
Using 'haveKey' is not a valid Chai method
4fill in blank
hard

Fill both blanks to create a test that checks if the API response status is 200 and the response time is less than 300ms.

Postman
pm.test('API health check', function () { pm.expect(pm.response).to.have.status([1]); pm.expect(pm.response.responseTime).to.be.[2](300); });
Drag options to blanks, or click blank then click option'
A200
Babove
Cbelow
D404
Attempts:
3 left
💡 Hint
Common Mistakes
Using 404 status code means not found error
Using 'above' checks for longer response time
5fill in blank
hard

Fill all three blanks to write a test that verifies the response JSON has a 'status' key with value 'ok' and response time less than 250ms.

Postman
pm.test('Complete API health check', function () { const jsonData = pm.response.json(); pm.expect(jsonData).to.have.[1]('status'); pm.expect(jsonData.status).to.eql([2]); pm.expect(pm.response.responseTime).to.be.[3](250); });
Drag options to blanks, or click blank then click option'
Aproperty
B'ok'
Cbelow
D'OK'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'OK' instead of 'ok' causes test failure
Using 'include' instead of 'property' for key check