top of page
Search

Passing external test data in postman

If you haven't created your first collection, check here.


You can pass data via two ways.

  1. Using csv file

  2. Using text file

Let's see how to do that,



Step 1:

First you should create your test data file either in csv format or text file format.

  1. CSV files should be written in a format that first row should have column names next rows will have the data. Numbers and Boolean values are written with (') single quote in front to keep its format.

  2. Text files should be written in JSON format and saved as json file.

ree

ree

Step 2:

Under Body section in your request tab, declare the variables in json format you want to get data from external source.

All variable names should be mentioned within {{ }} double curly braces. String variables should be mentioned within double quotes "{{variable_Name}}".


ree

Step 3:

Go to collection runner, click Run, Select the data file you have your data and click preview to check that correct data file is imported.


ree

ree

ree

ree

Click Run to see that postman picked your data file and executed collections.


ree

You can see there are two iterations executed as we have passed two data sets in our data.json file.

ree

You can check the data passed in console.

ree

Thus we have passed data for our requests from external source successfully.


Happy Testing!!!





 
 
 

Recent Posts

See All

Comments


bottom of page