My question: I want to see whether is it possible to assign the status of the response to any variable or constant? I want to have the if condition where if status is “201 created” then particular test cases should not run.
Thank you:)
My question: I want to see whether is it possible to assign the status of the response to any variable or constant? I want to have the if condition where if status is “201 created” then particular test cases should not run.
Thank you:)
The response code is available in script as pm.response.code
, so you could do something like this:
if(pm.response.code != 201) {
pm.test("This test is safe to run", function () {
// Write whatever you want to test in here
}
}