I want to test the collection Test Server in Postman Collection Runner. However, when I run my tests they don't respond with a pass or fail. Postman only displays "No test" as a result.
Why are my tests returning "No test" in the Postman Collection Runner? How do I run my tests?
Adding tests You can add tests to individual requests, collections, and folders in a collection. Postman includes code snippets you add and then change to suit your test logic. To add tests to a request, open the request and enter your code in the Tests tab. Tests will execute after the request runs.
Open the collection runner, Select the required collection and request, select the “save responses” checkbox and run it. click on individual request, select the response body and manually copy the response and paste it to locally which is not feasibly because we can't do manually one by one for 100 requests.
You can get this information from the Runner but clicking on the Request Name , which will display those details. To export the whole run results into a file, which would contain all the information, you would need to use Newman to run the collection file from the command line.
Like previously mentioned, you need to write some tests for your requests in order to see these being executed in the Collection Runner. Without these, all the runner is doing, is just sending requests to the endpoints specified in your collection.
An example of a basic status code check:
pm.test("Status code is 200", function () {
pm.response.to.have.status(200);
});
This can be added to the Tests
section of the request builder:
More information can be found in the Postman Documentation about writing tests in your requests. Some more basic test examples can also be found on this page.
Postman have recently added the ability to create tests at the Collection and sub-folder level, to help to reduce the amount of test repetition - Checking for a response status code is a potential candidate that could be applied at the Collection level and be run against all of your requests, from a single location. More details can be found in this Postman blog post.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With