Newman: Invalid opening quote at line 3

Created on 21 Sep 2017  路  13Comments  路  Source: postmanlabs/newman

  1. Newman Version (can be found via newman -v): 3.8.0
  2. OS details (type, version, and architecture): Microsoft Windows [Version 10.0.15063], AMD64
  3. Are you using Newman as a library, or via the CLI? CLI
  4. Did you encounter this recently, or has this bug always been there: Have only recently tried
  5. Expected behaviour: Newman should parse the JSON data file successfully
  6. Command / script used to run Newman: newman run "xxxx.postman_collection.json" -n 3 --f testFolder -e xxxx.postman_environment.json -d "TestData.json" --ssl-client-cert xxxx.crt --ssl-client-key xxxx.key --ssl-client-passphrase xxxx
  7. Sample collection, and auxilliary files (minus the sensitive details):

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

  1. Screenshots (if applicable):
    output:
    Invalid opening quote at line 3

bug

All 13 comments

It works for only csv file

Practice.zip

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.

Was this page helpful?
0 / 5 - 0 ratings