Complete the code to check the response size in Postman.
pm.test('Response size is less than 2KB', function () { pm.expect(pm.response.size().bodySize).to.be.[1](2048); });
The lessThan assertion checks if the response size is smaller than 2048 bytes (2KB).
Complete the code to assert the response size equals exactly 500 bytes.
pm.test('Response size equals 500 bytes', () => { pm.expect(pm.response.size().bodySize).to.equal([1]); });
equal for exact match.The equal assertion checks if the response size is exactly 500 bytes.
Fix the error in the code to correctly assert the response size is greater than 1KB.
pm.test('Response size is greater than 1KB', function() { pm.expect(pm.response.size().bodySize).to.be.[1](1024); });
The above assertion checks if the response size is greater than 1024 bytes (1KB).
Fill both blanks to assert the response size is between 1KB and 3KB.
pm.test('Response size is between 1KB and 3KB', () => { pm.expect(pm.response.size().bodySize).to.be.[1](1024).and.[2](3072); });
above and below.The code checks that the response size is greater than 1024 bytes and less than 3072 bytes.
Fill all three blanks to create a test that asserts the response size is not equal to 0 and less than 5KB.
pm.test('Response size is valid', () => { pm.expect(pm.response.size().bodySize).to.not.[1](0).and.[2]([3]); });
above instead of lessThan for the second assertion.The test asserts the response size is not zero and is less than 5120 bytes (5KB).