Skip to content

Make Selenium Easy

And Keep It That Way

  • Home
  • Share
  • Toggle search form

Postman Tutorial Part 44 – Data Driven Testing in Postman Using CSV File – Make Selenium Easy

Posted on 05/19/2022 By admin

Hello Folks,

We have already seen How to read data from a csv file in Postman.

I have not discussed a major purpose of usage of data files in Postman yet. We are going to learn about that in this post.

The major usage of reading data from files such as JSON and CSV in Postman is to achieve Data Driven Testing. Did not understand the term Data Driven Testing? Let me explain.

Suppose we have an API to login to application and gives valid token only on successful credentials and meaningful error messages on wrong credentials. You need to test below scenarios for above API:-

  1. Both username and password are correct.
  2. Both username and password are incorrect
  3. Only username is incorrect
  4. Only password is incorrect
  5. Username is missing
  6. Password is missing

To test all above scenarios for API, you have two options:-

  1. Create as many requests as scenarios i.e. six different requests for different request body
  2. Use Data driven testing i.e run single request with different set of data.

API will behave based on data you are passing. You just need to pass different set of data to same API. This we can achieve easily using data files feature in Postman.

Let’s understand this with example:-

In How to read data from a csv file in Postman ,I purposefully created just single row of data. In fact, each row is a set of input data to API. If your data file consists of five rows, API will run five times considering each row as new set of data.

I will consider the same API used in How to read data from a csv file in Postman . Now I want to do multiple booking with different data. Let’s create a sample CSV first. Each new set of data should be a row in csv.

So my csv file will look like as below:-

So the booking API will run thrice. First data row (2) will be used for first run, second data row will be used for second run and so on.

You do not need any extra setup to run. You just need to run API using collection runner and select the csv file in Data section.

Run the collection, you will see three iteration have run with different data.

Data for iteration 1:-

Data for iteration 2:-

Data for iteration 3:-

#ThanksFoReading

You can find all Selenium related post here.
You can find all API manual and automation related posts here.
You can find frequently asked Java Programs here.

My name is Amod Mahajan and I am an IT employee with 6+ years of experience in Software testing and staying in Bengaluru. My area of interest is Automation testing. I started from basics and went through so many selenium tutorials. Thanks to Mukesh Otwani as his tutorials are easy and cover basics to advance. I have habit of exploring concepts by deep diving. I used to make notes. I thought of sharing my knowledge through posts and now I am here. #KeepLearning #ShareLearning

Uncategorized

Post navigation

Previous Post: Make Selenium Easy – Page 3 of 57 –
Next Post: Postman Tutorial Part 24 -Set, Get and Unset Global & Environment Variables in Postman Scripts – Make Selenium Easy

Related Posts

DefualtPriority – Make Selenium Easy Uncategorized
OutPutInnerClass – Make Selenium Easy Uncategorized
API Testing – REST Assured Archives – Page 2 of 4 – Make Selenium Easy Uncategorized
Postman Tutorial Part 30-Extracting and Asserting Request & Response Headers in Postman Uncategorized
API Testing – Page 7 Uncategorized
API Testing – Page 3 Uncategorized

Recent Posts

  • Getting Started with Selenium 4: What Is New and How to Upgrade from Selenium 3
  • Manual Testing
  • Baby Steps To Become Efficient Selenium-Java Automation Tester
  • Features of Selenium 4.0.0 Release – Java Binding
  • Part 1: Handling Drop-down Created Using SELECT Tag In Selenium

Recent Comments

No comments to show.

Archives

  • April 2026
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • April 2024
  • March 2024
  • February 2024
  • December 2023
  • October 2023
  • August 2023
  • November 2022
  • September 2022
  • August 2022
  • July 2022
  • May 2022
  • March 2022
  • October 2021
  • April 2021
  • March 2021
  • January 2021
  • December 2020
  • October 2020
  • September 2020
  • August 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • May 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • January 2018

Categories

  • Getting Started
  • Uncategorized

Copyright © 2026 Make Selenium Easy.

Powered by PressBook Masonry Dark