Prabakaran
Prabakaran

Reputation: 45

CSV file data not replaced in request while running multiple test data for API in POSTMAN

I am testing my API with postman app and list of requests. The list of different requests are placed in CSV file in below format:

 path value
 post "myrequestdata1"
 post "myrequestdata2"
 ...  ...

but during my run it takes only the request which i mentioned initial test.

My request body :

 {
     "requestID": "xxxxxxx",
     "clientRequestHandle": "YYYYYYY",
     "items":{
                          "AppNumber": "105",
                        "AppId": "105",
                        "AppInfo": [{}, {}]
 }
  }

my csv data represents:

 path, value
 post,"{  "requestID": "xxxxxxx",  "clientRequestHandle": "YYYYYYY",  "items":{ "AppNumber": "105", "AppId": "105", "AppInfo": [{}, {}] } }"
 post,"{  "requestID": "xxxxxxx",  "clientRequestHandle": "YYYYYYY",  "items":{ "AppNumber": "106", "AppId": "106", "AppInfo": [{}, {}] } }"
 post,"{  "requestID": "xxxxxxx",  "clientRequestHandle": "YYYYYYY",  "items":{ "AppNumber": "107", "AppId": "107", "AppInfo": [{}, {}] } }"

Folks help me on this...

Upvotes: 1

Views: 439

Answers (1)

Stepan
Stepan

Reputation: 1054

You need to escape quotes symbols like this in your csv-file:

path, value
post,"{  ""requestID"": ""xxxxxxx"",  ""clientRequestHandle"": ""YYYYYYY"",  ""items"":{ ""AppNumber"": ""105"", ""AppId"": ""105"", ""AppInfo"": [{}, {}] } }"
post,"{  ""requestID"": ""xxxxxxx"",  ""clientRequestHandle"": ""YYYYYYY"",  ""items"":{ ""AppNumber"": ""106"", ""AppId"": ""106"", ""AppInfo"": [{}, {}] } }"
post,"{  ""requestID"": ""xxxxxxx"",  ""clientRequestHandle"": ""YYYYYYY"",  ""items"":{ ""AppNumber"": ""107"", ""AppId"": ""107"", ""AppInfo"": [{}, {}] } }"

and use the following Request Body in request:

{{value}}

Upvotes: 0

Related Questions