![postman download zip response postman download zip response](https://www.orioninstruments.com/sites/default/files/synced/blog/calculating_levels.jpg)
In this example, I am looking for 3 different country codes.
#Postman download zip response code#
It has 3 column, where the first column is test case ID and the second one is country code which is used in the request and the third one is the country name, which is used for asserting the response received. JSON file should be an array of the keyvalue pair where the variable name is the key.ĭata file used in this example is below. For CSV files, the first row should be the variable names as the header. Postman supports both CSV and JSON format. Below screenshot shows the test which is for validating country name based on the data file. It can be accessed as data.VARIABLENAME or data in both test and pre requisite scripts. The data coming from data file will be available under “data” dictionary ( similar to global/environment variable. Now write some tests to check the results. GET request used here is Įndpoint is defined in environment file and countrycode will be in data file Next step is to create a collection with a GET request and write tests to verify the response. Environment fileįirst, create an enviornment Manage Environment option at top right. Let us take a look to see how this can be achieved using postman data files. Let us assume that, we need to test this API with multiple country codes. This API will return the name of the country depending on the 2 digit code passed. This is available only when we run through postman collection runner or newman.įor this example, let us take a free public API. Luckily postman supports this by providing facility to use data files. One of the common requirement for automated testing is to run same test case against multiple test data.