This might be a dumb question: but how I can setup the success of an HTTP request to Success or Failed based on the HTTP Response Status Code?
I get responses with 500 and 400 response codes and they are marked as success. I looked at the available assertion options and for HTTP requests they seem to be dealing mostly just with the http response body.
The “Validate Response in Run and Debug Case” option is missing in our Project Settings. We are under the Professional plan. Is Enterprise needed?
Therefore I can’t find a way to achieve my goal by using option 1.
Also I want to specify that the Tests I am talking about needing the Success/Failure validation setting based on Http Status Code are not generated from/referencing to Endpoints in the Default Module.
Hello! Thank you for the detailed explanation. Let me confirm your scenario: you added a step directly via “Add HTTP request” in Tests, rather than importing or applying an existing API from Endpoint or Endpoint debug case.
If that’s the case, we recommend using Method 2 to solve this. You can create script assertions in custom scripts using pm.test syntax, as shown in the image below.