Is it possible to access the value of the response size in my postman test cases ?
While I am able to see the response size alongside the status code and the response time (both of which i can use in my test cases using responseCode.code and responseTime) I have not been able to use it in my tests. [I tried variables like responseSize and so forth to no success]
pm.response.responseSize
will give you the response size of the body.
Adding an example to Sbaddam's excellent answer:
pm.test("response size", function () {
pm.expect(pm.response.responseSize).to.be.equal(1252184);
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With