I’m looking for a way to test if the response time is below a certain threshold, without taking in to account the download time.
Currently I’m using the Postman snippet below to test the res time, to give us some indication of performance.
pm.test("Response time is less than 200ms", function () {
pm.expect(pm.response.responseTime).to.be.below(200);
});
But some of the API’s I’m testing are used to retrieve relatively large image files. For these API’s the res time snippet will consistently fail, because it takes a while for the files to finish downloading due to limited network speed.
When the download time is included in the response time it obscures the “real” performance of the API’s, because the download time heavily depends on the network speed,
It’s clear from the res time breakdown that Postman shows when you hover the mouse over the res time that Postman knows how long it takes before the download starts. This breakdown also shows that the res time would be sufficient if you ignore the download time.
I couldn’t find anything about it online, but is there a way to test the response time up until the download starts, so excluding the download time from the response time? Or something similar.