Using CSV files with Postman’s Collection Runner allows you to run a collection of requests with different sets of data. Here are the detailed instructions to use a CSV file and Postman to run the Collection Runner:
Step-by-Step Guide
1. Prepare the CSV File
Create a CSV file with the data you want to use in your requests. The first row should contain the variable names, and subsequent rows should contain the values. Here’s an example:
2. Set Up Postman Collection
- Open Postman and create a new collection or use an existing one.
- Add Requests to your collection that will use the data from the CSV file.
3. Add Variables in Requests
In your requests, use the variable names from the CSV file inside double curly braces. For example:
- URL:
https://api.example.com/users
- Body (if it’s a POST request)
4. Run Collection with Collection Runner
Open Postman and click on the Runner button at the top left (it looks like a stopwatch).
Select the Collection you want to run from the left sidebar.
Select the Environment (if any) you want to use.
Select the Data File:
- Click on the Choose Files button under Data.
- Select your CSV file.
Set the Iterations to the number of rows in your CSV file, minus the header row.
Click the Start Run button.