postman test status code code example
Example 1: postman test script get request code
tests["Status code is 200"] = responseCode.code === 200;
//log
console.log(tests["Status code is 200"] = responseCode.code != 200)
Example 2: how to test response in postman
Basicall we are checking response body
to verify if request matches with response.
In the response we are verifying
(body, status code, header, response time,
test structure of json against the given jsonSchema)