Table of contents
1.
Introduction
2.
Using Collection Runner
2.1.
Configuring a Collection runner
2.2.
Running the Collections
2.3.
Viewing Test results
2.4.
Viewing Iterations
2.5.
Sharing Collection runner
2.6.
Automating Collection runner
3.
Scheduling runs with monitors 
3.1.
Adding a monitor to your project
4.
Frequently Asked Questions
4.1.
What is a JSON Postman collection?
4.2.
How do API calls take place?
4.3.
How does monitoring an API operate?
5.
Conclusion
Last Updated: Mar 27, 2024

Using the Collection Runner and scheduling runs with monitors in postman

Author Ashish Sharma
0 upvote

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.

run symbol


📭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.

Number of Iteration


📭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.

Running the collection

 

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.

run's overview page

 

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.

Scheduling runs with monitors 

Postman Monitors are used to make sure that an API's performance and response are being appropriately maintained. For the duration of the day, monitors are scheduled at regular intervals of minutes, hours, or weeks.

Utilizing monitors to schedule runs and get information on the outcomes of your request tests, you may automate collection runs.

Adding a monitor to your project

Select Monitors in the sidebar to add or access monitors for a certain collection.           

Adding monitor to project

 

There will be any monitors that are currently connected to your collection. To add a monitor, choose to Create a Monitor (or + Create a New Monitor if there is already one on the collection).

Additionally, a monitor from a collection can be added. Choose the collection to which you wish to add a monitor, then choose More actions > Monitor collection from the menu.

Choose a collection to use, a version tag, and an optional environment to reference for your scheduled collection runs when naming your monitor. Choose a region and enter the frequency you want your monitor to operate on. Once you click Create, your monitor will start to follow the schedule you specified.

Creating a monitor

 

The monitor overview will show your new display. To examine your monitor results at any moment, enter the monitor overview tab.               

Monitor Overview

Frequently Asked Questions

What is a JSON Postman collection?

Create or load a programmable JavaScript object that represents a Postman Collection instance. You can assemble several requests into collections. To exactly replicate your API, these requests can be further divided into folders. Requests that are maintained as collections can also store sample responses.

How do API calls take place?

Simply, an API call occurs when you append an endpoint to a URL and submit a request to a server. For instance, you are essentially performing an API call when you use a browser to ask a query or log into any app.

How does monitoring an API operate?

A remote machine is used by an API monitor to make calls to the API. The API response is assessed by the computer for its speed, content, and response codes. The monitoring service logs an error if any aspect of the answer doesn't match expectations.

Conclusion

In this article, we have extensively discussed the introduction to the Collection Runner, configuration, running, sharing, automation of a collection run, and scheduling run with the monitor.

After reading about using the Collection Runner and scheduling runs with monitors in postman, are you not feeling excited to read/explore more articles on the topic of file systems? Don't worry; Coding Ninjas has you covered. If you want to check out articles related to API testing then you can refer to these links, Introduction to the postmanAPIAPI testingpostman for api testinghow api call worksand Web testing.

Refer to our Guided Path on Coding Ninjas Studio to upskill yourself in Data Structures and AlgorithmsCompetitive ProgrammingJavaScriptSystem Design, and many more! If you want to test your competency in coding, you may check out the mock test series and participate in the contests hosted on Coding Ninjas Studio! But suppose you have just started your learning process and are looking for questions asked by tech giants like Amazon, Microsoft, Uber, etc. In that case, you must look at the problemsinterview experiences, and interview bundle for placement preparations.

Nevertheless, you may consider our paid courses to give your career an edge over others!

Do upvote our blogs if you find them helpful and engaging!

Happy Learning! 

Live masterclass