CSV File with Quotes Parsed Correctly in Collection Runner, but not in Newman
See original GitHub issue- Newman Version (can be found via
newman -v
): 4.5.5 - OS details (type, version, and architecture): Windows 10 x64
- Are you using Newman as a library, or via the CLI? CLI
- Expected behaviour: CSV file be parsed correctly, as it is in the postman collection runner
- Command / script used to run Newman: newman run “$collection” -e “$environment” --folder “Default” -d $pathToTestData + “Default.csv” -r $reportType
I can do a collection run with no issues in the collection runner, however when doing the same collection run in newman, an error message will be thrown. The issue appears to be a difference in the way the csv file is parsed in newman vs in the collection runner. The csv file contains multi line values, as well as values that contain double quote characters.
It seems that the collection runner correctly escapes the commas before running while newman does not. Here is an example showing the preview data window in the collection runner:
Here is a look at the raw text of the same csv file:
Steps to reproduce
- Create a csv file that includes double quotes
- Pass in the csv file to newman via the -d option
- Attempt to run this newman command
- Get the following error message: error: Invalid Closing Quote: got “”" at line 2 instead of delimiter, row delimiter, trimable character (if activated) or comment
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
CSV File with Quotes Parsed Correctly in Collection Runner ...
The issue appears to be a difference in the way the CSV file is parsed in Newman vs in the collection runner. The...
Read more >CSV File with Quotes Parsed Correctly in Collection Runner, but not ...
CSV File with Quotes Parsed Correctly in Collection Runner, but not in Newman.
Read more >Newman CLI treating strings in CSV differently from POSTMAN
Expected behaviour: I need to use a CSV file to import data into the response body of POST requests. All values MUST be...
Read more >Read from CSV and write the result back to CSV (PASS/FAIL)
Is there a way I can add the pass/fail status of my Postman tests to my CSV file ? Yes, there is. This...
Read more >How to send double quotes in postman csv data file
This is interesting,. Newman and the collection runner are behaving differently. I have raised a bug on postman for this :.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@codenirvana I’m getting a similar error:
error: Invalid opening quote at line 2
The csv datafile that I’m using looks like this:
It only has one double quote (in comparison to
"""
like the problem above)I can’t figure out how to work around this problem (untill v5 is released). How do I escape the quotes for it to work?
@SimonVHB I was able to verify if you do “[”“5dd…427"”]" That will work in the Collection Runner in Postman, which I feel should be the recommended alternative, rather than \" which is not part of RFC 4180