postman test results code example

Example: how do you test in postman

I mostly use preInstalled js testScripts in postman
in Tests tab. Basically test will execute after
response received for verification. So when I send
the request by clicking SEND postman runs the test
script and after response gives me test result

Some of the snippets I use:

Get an environment variable
Set an environment variable
Clear a environment variable
Clear a global veriable
Get a global variable
Set a global variable
Send a request
Response convert xml to json
Response time is less than

pm.test("Status test", function () {;

pm.test("response must be valid and have a body", function () {;;;