newman -v): 3.8.0TestData.json
[
{
"Iteration": 1,
"expectedResponseCode": 200,
"expectedAppResCode": 0,
"expectedErrMessage": ""
},
{
"Iteration": 2,
"expectedResponseCode": 200,
"expectedAppResCode": 0,
"expectedErrMessage": ""
},
{
"Iteration": 3,
"expectedResponseCode": 400,
"expectedAppResCode": 3004,
"expectedErrMessage": "Access token is invalid or expired."
}
]
It works for only csv file
Even with this simple collection facing same problem.
C:\Practice>newman run Practice.postman_collection.json -n 2 -d Practice.json
Invalid opening quote at line 3
@amnoman This is happening because the contents of your JSON data file have an extra space at the beginning, which is invalid JSON. While a patch is released, a temporary workaround is to remove the leading space from the JSON data file.
On a different note, the test script for the first request in your collection contains a reference to test instead of tests, which will result in reference errors when run.
@amnoman A fix for this bug has been added in #1218, I'll update this thread when it has been released.
Thanks for the finding but after removing all extra space getting different error:
newman run Practice.postman_collection.json -n 2 -d Practice.json
Invalid closing quote at line 3; found ":" instead of delimiter ","
Practice.json
[
{
"Iteration":"1",
"MNO":"Verizon"
},
{
"Iteration":"2",
"MNO":"ATT"
}
]
@amnoman Could you try this out with Newman v3.8.3-beta.1?
After updating to v3.8.3-beta.1 it's working fine. Thanks :)
I am running 3.8.3 and am getting this error. I even removed all spaces in the file and am still getting "Invalid opening quote at line 1" :(
I am facing same issue, while reading csv file having data within "" and running with newman.
Below is the sample data from csv file
format-1 tried
SlNo | loanProduct
2 | "Regular"
format-2 tried < failed in both POSTMAN and newman>
SlNo | loanProduct
2 | "\"Regular\""
While running in newman, error shows
fyi: I used excel sheet to convert to csv file and having newman version 3.9.3
I had the same problem, the csv data file worked in Postman but not in Newman.
To resolve the issue, after saving the file from Excel I replace all double double quotes "" with backslash double quote \"
Replaced double quotes with backslash double quote but no luck.
Here is my input JSON :
{loanProduct: \"Regular\",disclosure: \"EIR\",loanAmount: \"25236.21\",FeeAmount: \"175\"}
and got error
Invalid closing quote at line 2; found "R" instead of delimiter ","
Replacing the double quotes worked with CSV, I wasn't using JSON.
In CSV file, Replaced double quotes with backslash double quote.
Same my constructs my input JSON in CSV file. In more details I have a excel file having columns loanproduct, disclosure, loan amount, feemount and their corresponding values (\"Regular\", \"EIR\", \"25236.21\", \"175\"). Then I generates the input JSON in another column (ex: inputxyz). Post that SAVE the file in CSV format.
Now my input JSON in CSV file looks like
{loanProduct: \"Regular\",disclosure: \"EIR\",loanAmount: \"25236.21\",FeeAmount: \"175\"}
Then calls that CSV file with the new column header (ex: inputxyz) in NEWMAN to run the script.