Introduction
In this article, we will discuss the introduction to the Collection Runner, configuration, running, sharing, automation of a collection run, and scheduling run with the monitor.
The Collection Runner is where things start to become much more interesting since this is where you'll start automating the execution of the requests you've accumulated in the Collection files.
Collection Runner can be customized to suit your development requirements. You can provide data files into a run and use a specified environment to execute collections.
Using Collection Runner
You can automate API testing with collection runs, and monitors can be used to schedule runs. Using Newman, a Postman tool that lets you run and test collections straight from the command line, you can also incorporate collection runs with your CI/CD pipeline.
You can run the API calls in a collection in a specific order using the Collection Runner. It can use scripts to transmit data between requests and change the request workflow, and it logs your request test results.
Configuring a Collection runner
Setting up a collection run involves:
📭The collection you want to run can be found under Collections on the sidebar.
📭Select the Runner symbol ▶️ Run, under the overview tab.
📭You have the ability to specify additional configuration parameters before beginning a collection run:
✴️Iterations - How many times your collection run will iterate. Workflows can be created by running collections on various data sets numerous times.
✴️Delay: A delay is the amount of time, measured in milliseconds, between each request.
✴️Data: A collection run's data file.
✴️Save responses - Save the bodies and headers of responses to the log for later perusal. Performance may be impacted by this option for lengthy collection runs.
✴️Keep Variable Values: This option ensures that any variables updated by the run will continue to be modified after it has finished. Variable changes are not stored once the run is finished if variables are not persistent. Keep in mind that collection run variables that persist will only update the current value.
✴️Run the collection without using any stored cookies - If your requests make use of cookies, you have the option to turn them off throughout the run of the collection.
✴️Cookies saved after collection run - Add the session's cookies to the cookie manager. Requests made during the run will have no effect on any values after it is over.
📭Use the environment selection in the workbench's upper right corner to choose the environment your collection should run against. The environment you want to utilise can also be chosen by choosing Environments in the sidebar.
📭By default, your queries are executed in the collection's list order. Select a request and drag it to the new order you want it to be executed in if you need to change the order. By unchecking the box next to a certain request's name, you can also delete that request from the run.
Running the Collections
Real-time test results and request executions are displayed by Postman. Select a request's name from the list of results to gain access to further information about what transpired when it was executed.
Select the Console icon from the footer to examine further information, including any log statements utilized in your collection.
Select View Summary to see the run's specifics. You can evaluate test results for the whole run by using the summary column for each iteration of your collection run.
Select View Results to go back to the run's overview page.
Viewing Test results
The View Results page shows whether each request succeeded or failed if your collection has tests. The Passed and Failed tabs at the top allow you to filter on each as well. A request script's tests are executed during the collection run, and if any of them fail, the entire request fails.
Viewing Iterations
You can get the overview for each iteration if you set an iteration number for the collection run by choosing it from the list on the right.
Sharing Collection runner
By exporting the results from the Collection Runner, you can distribute collection run results to others.
A collection run can be exported by:
📮Go to the Runner and select the collection run. If the run is not open, you can still access the collection run by clicking History on the sidebar.
📮To download the run, click Export Results in the top right corner.
📮Select Save after deciding where to save your downloaded collection run.
Automating Collection runner
To add automation to your API applications, you may also employ collection runs in conjunction with other Postman tools.
📭You may execute collections using Newman, the Postman command-line interface, and include them into your development workflow to respond to test results and support the performance of your API.
📭Your collection will benefit from having a monitor if you want to schedule collection runs and keep track of any problems.
📭Additionally, you may configure a collection webhook to start a collection run at a certain time with a unique payload.