Complete the code to check if the response time is less than 200 milliseconds.
pm.test("Response time is less than 200ms", function () { pm.expect(pm.response.[1]).to.be.below(200); });
The pm.response.responseTime property gives the response time in milliseconds in Postman tests.
Complete the code to fail the test if response time exceeds 500 milliseconds.
pm.test("Response time is acceptable", () => { pm.expect(pm.response.[1]).to.be.below(500); });
Use pm.response.responseTime to get the response time in Postman tests.
Fix the error in the code to correctly assert response time is under 1000 ms.
pm.test("Response time check", function() { pm.expect(pm.response.[1]).to.be.lessThan(1000); });
The correct property is responseTime. Also, to.be.lessThan() is valid in Chai assertions used by Postman.
Fill both blanks to assert response time is between 100 and 300 milliseconds.
pm.test("Response time range", () => { pm.expect(pm.response.[1]).to.be.[2](100).and.to.be.below(300); });
Use responseTime property. The assertion to.be.above(100) checks the lower bound.
Fill all three blanks to assert response time is between 200 and 400 ms and log it.
pm.test("Response time check and log", () => { const time = pm.response.[1]; pm.expect(time).to.be.[2](200).and.to.be.[3](400); console.log(`Response time: ${time} ms`); });
Use responseTime property. above checks greater than 200, below checks less than 400.