tests["Status Code should be 200"] = responseCode.code === 200 tests["Response time lesser than 10ms"] = responseTime<10
The tests is a variable of type array which can hold data types- integer, string, Boolean and so on. The Status Code should be 200 and Response time lesser than 10ms are the test names. The responseCode.code is the code obtained in the Response and the responseTime captures the time taken to obtain the Response.
Select the GET method and enter an endpoint then click on Send.
Click on the Test Results tab in Response.
The Test Results tab displays the test which has passed in green and the test which has failed in red. The Test Results (1/2) means one out of the two tests has passed. Response shows the status as 200 OK and response time as 129ms (the second test checks if the response time is lesser than 10ms).