Hello, I have been executing some bulk actions using the Collection Runner and during some runs, our web server backend suffered a glitch which resulted in Postman reporting ECONNRESET. The glitch recovered itself and is being investigated, but I want to improve my test and assertion flow to handle the issue should it occur again in my sequences.
I submitted a support request and receive the following response, which does not quite provide an answer: “Because this is a node-level error, Postman doesn’t have a way to detect it by scripting (test logic). The reason is that with this error, there will be no response to test in pm.request, pm.response, or responseCode”
Personally, I don’t quite believe the answer; there must be a way. It just has to be different to a normal HTTP Status Code test/assertion.
It is a rare and intermittent issue, so it isn’t something I can reproduce easily, so asking if anyone else has any suggestions.
Here are some things I already do, or am exploring:
-
My scripts already assert for a successful response using pm.test (… { pm.response.to.not.be.error }) and in the case example, this assertion did fail.
-
Might I see something in a variable such as pm.response.error? I observe that on a successful request, pm.response.error is undefined; but I cannot find any documentation or tickets that list viable values that this property may return.
-
I could test for the absence of a property, for example: pm.has.response . (This syntax errors in the successful response case, so probably not)
My instinct tells me #2 is the most likely, but I just don’t know what value to assert against.