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.

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}}".

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.

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

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

You can check the data passed in console.

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

Happy Testing!!!

52 views0 comments

Recent Posts

See All

A string s is called good if there are no two different characters in s that have the same frequency. Given a string s, return the minimum number of characters you need to delete to make s good. The f

The numeric value of a lowercase character is defined as its position (1-indexed) in the alphabet, so the numeric value of a is 1, the numeric value of b is 2, the numeric value of c is 3, and so on.