I have a Postman collection that is ran periodically as a Postman monitor. Due to a general instability of a service under test, I have to retry one of the requests up to 3 times before declaring it as an execution failure. The conditional loop is created with the help of postman.setNextRequest
.
Everything works nicely, but I would like to go one step further and control the overall execution result depending how many retries have been made. That is, I want to somehow say to Postman monitor that if the retry iteration is 1 or 2, the monitor result is still “OK”, but if it is 3, the last iteration, then the result it “FAIL”. Currently, the run is marked as failed whenever there were some failed test, even if the later request retry does succeed.
Is there a Postman variable that accumulates run result over performed tests? I could try resetting it by the test action or may be there are some alternative solutions for such a setup?
Thanks for ideas and suggestions!