Skip to content

Run Postman collections from the command line with support for various authentication types and detailed execution logs. Generates a summary report with success/failure counts and execution times.

License

Notifications You must be signed in to change notification settings

Am4nn/Run-Postman-Collection-Concurrent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Postman Collection Runner

This project is a Node.js utility to run requests from a Postman collection concurrently. It reads the Postman collection JSON file, processes the requests, and executes them using the axios library. The tool provides detailed logs for each request's execution status (success or failure) and tracks the execution time, along with a summary report of the test run.

Features

  • Parse Postman collection JSON and extract requests and global information.
  • Support for multiple authentication types: API Key, Bearer, Basic Auth.
  • Run requests concurrently using Promise.allSettled for better performance.
  • Log success and failure of each request along with execution time.
  • Generate a summary report with total execution time, successful/failed requests, and average time per request.

Prerequisites

Before you run the project, make sure you have the following installed:

  • Node.js (v14 or higher)
  • npm (comes with Node.js)

Installation

  1. Clone the repository to your local machine:

    git clone https://github.com/your-username/postman-collection-runner.git
  2. Navigate to the project directory:

    cd postman-collection-runner
  3. Install the required dependencies:

    npm install

Usage

1. Prepare the Postman Collection

Make sure you have a Postman collection JSON file. If you don't have one, you can export a collection from Postman by following these steps:

  • Open Postman.
  • Go to your collection and click on the three dots (...).
  • Select Export and choose the format Collection v2.1 (recommended).
  • Save the JSON file.

2. Run the Script

Place your Postman collection JSON file in the postman-collections directory or update the path in the script.

To run the utility, use the following command:

npm start

This will execute the requests in the collection concurrently and log the results in the terminal. You will also see a summary report at the end of the execution.

3. Customization

  • Collection Path: Update the COLLECTION_PATH variable in the index.js file to point to your collection file.

  • Authentication: The tool supports multiple authentication types (API Key, Bearer Token, Basic Auth). Make sure to include the appropriate auth information in your Postman collection.

Example Output

The output will show detailed logs for each request and a summary at the end:

✅ [Request 1] - Success Time Taken: 123.45 ms Data: User 1 Details ❌ [Request 2] - Failed Time Taken: 98.23 ms Error: Network Error ✅ [Request 3] - Success Time Taken: 65.12 ms Data: User 2 Details Summary Report: Total Requests: 3 Successful Requests: 2 Failed Requests: 1 Total Execution Time: 350.23 ms Average Time per Request: 106.56 ms

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Run Postman collections from the command line with support for various authentication types and detailed execution logs. Generates a summary report with success/failure counts and execution times.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published