Complete the code to set a timeout for a Postman request.
pm.test('Response time is acceptable', function () { pm.expect(pm.response.responseTime).to.be.below([1]); });
The responseTime is a number in milliseconds, so we compare it to a number like 2000 (2 seconds).
Complete the code to check if the response size is less than a limit.
pm.test('Response size is within limit', function () { pm.expect(pm.response.responseSize.[1]).to.be.below(5000); });
The responseSize property returns an object, so we use size to get the total size in bytes.
Fix the error in the code that checks if the response time is less than 1000 ms.
pm.test('Response time check', function () { pm.expect(pm.response.responseTime [1] 1000).to.be.true; });
To check if response time is less than 1000, use the less than operator <.
Fill both blanks to check if the response status is 200 and response time is below 1500 ms.
pm.test('Status and performance check', function () { pm.expect(pm.response.code).to.be.[1](200); pm.expect(pm.response.responseTime).to.be.[2](1500); });
Use equal to check status code equals 200, and below to check response time is less than 1500.
Fill all three blanks to create a test that checks response time below 1000, status code 200, and response body contains 'success'.
pm.test('Complete non-functional test', function () { pm.expect(pm.response.responseTime).to.be.[1](1000); pm.expect(pm.response.code).to.[2](200); pm.expect(pm.response.text()).to.include('[3]'); });
We check response time is below 1000, status code equals 200, and response text includes 'success'.