Setup Script; Run Setup script before running group of tests

If you are running a group of tests (whether it be tests in collection or tests in folder), is there somewhere in postman where you can run a initial setup script … a script that will Only run before the test execution starts and will NOT run before each tests (like the pre-request scripts do)?

Ok, so you actually run a group of requests. Not tests.

The pre-request scripts are just that. They run before the request.

A request doesn’t neccessarily need to have tests.

You can also have tests in a pre-request script, as well as in the tests tab.

You can add scripts at the request, folder, or collection level. Using the pre-request scripts to run before a request, and the tests tab to run after the request.

I going to guess that you mean you want to run a single setup script before you run a folder or collection? In which case, it would make sense to put that script in the pre-request script for the first request in the collection or folder which means it should only run once.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.