Postman Collection Runner returns "No test" when running tests

Toi Nguyen picture Toi Nguyen · Jul 14, 2016 · Viewed 9.7k times · Source

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?

Collection Runner returning "No tests"

Answer

Danny Dainton picture Danny Dainton · Dec 28, 2017

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:

enter image description here

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.