Skip to content

NewMan removes leading zeros from string data that looks like a number #1346

Closed
@mgroeneweg

Description

  1. Newman Version (can be found via newman -v): 3.9.1
  2. OS details (type, version, and architecture): Windows 10, 64bits
  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: today
  5. Expected behaviour: Do not take off leading zeros from string values.
  6. Command / script used to run Newman: newman run TestLeadingZeros.postman_collection.json -d TestLeadingZeros.csv --reporters cli,json --reporter-json-export testreport.json
  7. Sample collection, and auxiliary files (minus the sensitive details):
  8. Screenshots (if applicable):

The CSV contains a value "008727100". It is enclosed in quotes. NewMan passes "8727100" to the server, which leads to a failure. These values are codes, not numbers.
When I run using collection runner, it leaves the value intact.

I reproduced this using a google search for 000123.
When running using collection runner, it searches for 000123.
When running using newman, it searches for 123

When a value is enclosed in quotes, it should not be interpreted but passed on to the service call as is.

I attached the files, but had to rename everything to txt extension.

TestLeadingZeros.txt
TestLeadingZeros.postman_collection.txt
TestLeadingZeros.postman_collectionrunner_test_run.txt
testreport newman.txt

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions