Data-Driven Testing in Postman

Data Driven Testing In Postman

In the previous articles on Postman Tutorial, we have covered “JSON Schema Validation in Postman

In this “Data-Driven Testing in Postman” article, I will be demonstrating how you can implement this concept and get a tight grip over this.

Data-driven testing is when we have one test that we run multiple times with different data variables. It’s useful for things like, if we have a certain range of characters that we’re supporting in our names, to make sure that all those characters are supported in different tests.

Let the body of API be:

Postman Data Driven Testing

Add tests in Tests tab:

Postman Data Driven Testing

Using CSV file:

1. Create a CSV file.
2. Add email, password in columns of CSV file
3. Add possible test cases of email and password.

Postman Data Driven CSV File

4. Create a collection named Data-driven test
5. To get variable from CSV file, run this collection on Runner, click Run button

Postman Data Driven Test

6. Collection Runner window will appear.

Postman Run Data Driven Test

7. Iterations are the no. of data rows in CSV file
8. Add CSV file in the Data option. Preview button will display the preview of CSV file
9. Click on Run button in blue color
10. Result window will be displayed

Postman Run Data Driven Test Result

Using JSON file:

1. Create a JSON file.
2. Add email, password in JSON file separated by a comma
3. Add possible test cases of email and password.

Postman Data Driven Using JSon

4. Create a collection named Data-driven test.
5. To get variable from JSON file, run this collection on Runner, click Run button

Postman Data Driven Using JSon File Collection

6. Collection Runner window will appear.

Postman Data Driven Using JSon File Collection Runner

7. Iterations are the no. of data rows in JSON file.
8. Add JSON file in the Data option. The preview button will display the preview of JSON file.
9. Click on the Run button in blue color.
10. The Result window will be displayed.

Postman Data Driven Using JSon File Result

Next steps:

Learn “Monitor Collections in Postman” in the next tutorial.

Author Bio: This article is written by Harsha Mittal an ISTQB-CTFL Certified Software Test Engineer having 3.5+ years of experience in Software Testing.

Related posts:

Data Driven Testing In Postman

Get our latest blog posts delivered to your inbox

Subscribe and get popular blog posts about software testing industry.

Rajkumar

Leave a Comment

Share via
Copy link
Powered by Social Snap