0
0
Postmantesting~10 mins

Response time benchmarking in Postman - Interactive Code Practice

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

Complete the code to get the response time of the API call.

Postman
pm.test('Response time is recorded', function () {
    var responseTime = pm.response.[1];
    pm.expect(responseTime).to.be.a('number');
});
Drag options to blanks, or click blank then click option'
AresponseTime
BresponseTimeMs
CresponseTimeInMs
DresponseTimeDuration
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect property names like responseTimeMs or responseTimeInMs.
2fill in blank
medium

Complete the code to assert the response time is less than 200 milliseconds.

Postman
pm.test('Response time is under 200ms', function () {
    pm.expect(pm.response.[1]).to.be.below(200);
});
Drag options to blanks, or click blank then click option'
AelapsedTime
BresponseTime
Cduration
Dtime
Attempts:
3 left
💡 Hint
Common Mistakes
Using properties that do not exist on the response object.
3fill in blank
hard

Fix the error in the code to correctly log the response time.

Postman
console.log('Response time:', pm.response.[1] + 'ms');
Drag options to blanks, or click blank then click option'
Atime
Bduration
CresponseTime
Delapsed
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect or non-existent property names.
4fill in blank
hard

Fill both blanks to create a test that fails if response time exceeds 500ms.

Postman
pm.test('Response time check', function () {
    pm.expect(pm.response.[1]).to.be.[2](500);
});
Drag options to blanks, or click blank then click option'
AresponseTime
Bbelow
Cabove
Dequal
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'above' instead of 'below' for the assertion.
5fill in blank
hard

Fill all three blanks to create a test that logs response time and asserts it is less than 300ms.

Postman
pm.test('Response time logging and check', function () {
    var time = pm.response.[1];
    console.log('Response time:', time + '[2]');
    pm.expect(time).to.be.[3](300);
});
Drag options to blanks, or click blank then click option'
AresponseTime
Bms
Cbelow
Dmilliseconds
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong property names or assertion methods.
Using 'milliseconds' string instead of 'ms' for logging.