0

I created a collection in Postman which contains a single request, I am running the collection by uploading a test case (.csv) file, It's working perfectly.

But I want to do the same via Newman. So I have installed the Newman and I have copied my collection link from the Postman, and but I don't know how to pass the test case file to it?

I tried this:

newman run https://www.getpostman.com/collections/944624fbc40ec677902e -d /path/to/file

but it's not working.

n-verbitsky
  • 552
  • 2
  • 9
  • 20
HARISH
  • 169
  • 5
  • 15
  • 1
    What is not working? Are you getting an error message? Does the .csv file contain data that's being referenced in the request using variables? – Danny Dainton Jan 23 '20 at 10:29
  • I am doing like this, newman run https://www.getpostman.com/collections/17207adeede6b5fa523b -d //Desktop//SAFE_TESTCASE_AUTOMATION//CC_API_INPUT_TESTCASES//safe.csv, for this I am getting newman: Newman v4 deprecates support for the v1 collection format Use the Postman Native app to export collections in the v2 format error: UNKNOWN: unknown error, open '\\Desktop\SAFE_TESTCASE_AUTOMATION\CC_API_INPUT_TESTCASES\safe.csv' error, I tried with single backslash also then also it saying unable to acces file – HARISH Jan 23 '20 at 10:52
  • for this newman run https://www.getpostman.com/collections/17207adeede6b5fa523b -d /Users/harish.shet/Desktop/SAFE_TESTCASE_AUTOMATION/CC_API_INPUT_TESTCASES/safe.csv error: Invalid opening quote at line 3 – HARISH Jan 23 '20 at 10:57
  • 1
    What is `data` in the `var newData = data` line? To assess the in the csv file from the Pre-request Script, you should use `pm.iterationData.get('your_csv_column_header')` – Danny Dainton Jan 23 '20 at 11:03
  • here data refers to the entire row in the csv, I am copying that to a another variable, as my api body requires keys: value=>(value should be in quotes,), here you find the sample row, METHOD,url,subscriber,action,numberType,sender,expected_response – HARISH Jan 23 '20 at 11:16
  • Seemingly you are using Windows, so could you try to pass Full Path to your .csv file instead of relative path? – n-verbitsky Jan 23 '20 at 12:04
  • Also, I would try to import collection and try to run Newman using collection on the local machine (without .csv file at first). If doesn't work as well, then most probably path issue. – n-verbitsky Jan 23 '20 at 12:07

0 Answers0