Complete the code to check if the response status is 200.
pm.test('Status code is 200', function () { pm.response.to.have.status([1]); });
The status code 200 means the request was successful. Checking this confirms the response is correct.
Complete the code to check if the response body contains the key 'success'.
pm.test('Response has success key', function () { pm.expect(pm.response.json()).to.have.property([1]); });
Checking for the 'success' key confirms the response includes expected data.
Fix the error in the assertion to check if the response time is less than 200ms.
pm.test('Response time is fast', function () { pm.expect(pm.response.responseTime).to.be.[1](200); });
The correct assertion method is 'below' to check response time is under 200ms.
Fill both blanks to check if the response JSON has a 'status' key equal to 'success'.
pm.test('Status is success', function () { pm.expect(pm.response.json()).to.have.[1]('status').that.[2]('success'); });
'property' checks the key exists, and 'equal' checks its value matches 'success'.
Fill all three blanks to validate the response JSON array length is greater than 0 and contains the key 'id'.
pm.test('Response array valid', function () { const data = pm.response.json(); pm.expect(data.length).to.be.[1](0); pm.expect(data[0]).to.have.[2]([3]); });
'above' checks length > 0, 'property' checks key exists, and 'id' is the key name.