Data-driven Testing Using CSV and JSON Files
What Is Data-driven Testing?
Data-driven testing runs the same request multiple times, each time with a different set of input values pulled from an external file, instead of hardcoding values into the request.
Supported File Formats
| Format | Structure |
|---|---|
| CSV | Column headers become variable names; each row is one iteration |
| JSON | Array of objects; each object's keys become variable names |
Using a Data File in the Runner
When starting a run in the Collection Runner, you can select a CSV or JSON file. Postman then runs the collection once per row/object, substituting the values wherever a matching variable is referenced.
Benefits
This approach lets you test many combinations of inputs - like different user accounts or product IDs - without duplicating requests or scripts.
Once data files are set up, scripts can read and act on that data during each iteration - let's look at how to iterate over data files in tests.
Ready to master Postman API Testing Course?
Join Uncodemy's hands-on training and build real-world API testing skills with expert mentors.