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.
- 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.allSettledfor 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.
Before you run the project, make sure you have the following installed:
-
Clone the repository to your local machine:
git clone https://github.com/your-username/postman-collection-runner.git
-
Navigate to the project directory:
cd postman-collection-runner -
Install the required dependencies:
npm install
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
Exportand choose the formatCollection v2.1 (recommended). - Save the JSON file.
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 startThis 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.
-
Collection Path: Update the
COLLECTION_PATHvariable in theindex.jsfile 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.
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 msThis project is licensed under the MIT License - see the LICENSE file for details.