Complete the code to get the response time of the API call.
pm.test('Response time is recorded', function () { var responseTime = pm.response.[1]; pm.expect(responseTime).to.be.a('number'); });
The correct property to get response time in Postman is responseTime.
Complete the code to assert the response time is less than 200 milliseconds.
pm.test('Response time is under 200ms', function () { pm.expect(pm.response.[1]).to.be.below(200); });
Use responseTime property to get the response time in milliseconds for assertion.
Fix the error in the code to correctly log the response time.
console.log('Response time:', pm.response.[1] + 'ms');
The correct property to access response time is responseTime.
Fill both blanks to create a test that fails if response time exceeds 500ms.
pm.test('Response time check', function () { pm.expect(pm.response.[1]).to.be.[2](500); });
Use responseTime to get the time and below to assert it is less than 500ms.
Fill all three blanks to create a test that logs response time and asserts it is less than 300ms.
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); });
Use responseTime to get time, append ms string for logging, and below for assertion.
