question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CSV File with Quotes Parsed Correctly in Collection Runner, but not in Newman

See original GitHub issue
  1. Newman Version (can be found via newman -v): 4.5.5
  2. OS details (type, version, and architecture): Windows 10 x64
  3. Are you using Newman as a library, or via the CLI? CLI
  4. Expected behaviour: CSV file be parsed correctly, as it is in the postman collection runner
  5. 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: image

Here is a look at the raw text of the same csv file: image

Steps to reproduce

  1. Create a csv file that includes double quotes
  2. Pass in the csv file to newman via the -d option
  3. Attempt to run this newman command
  4. 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:closed
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
SimonVHBcommented, Nov 25, 2019

@codenirvana I’m getting a similar error: error: Invalid opening quote at line 2

The csv datafile that I’m using looks like this: image 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?

1reaction
iheartdaikaijucommented, Dec 18, 2019

@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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found