I’m using Newman to run integration tests via Teamcity and a python script.
I’m using newman cli and --env-var parameters to pass in variables that I can’t store in github. Newman sends a request to my API with a different variable value than I passed in via env-var. I am assuming this has to do with the ‘$’ char. Everything between ‘$’ and ‘#’ is removed from the string. I’m at a loss as to how to correct it.
--env-var “password=12$123456?#12345”
Gets turned into: 12?#12345
The python script runs a newman cli command similar to this:
newman run integrationTests/API-Collection.postman_collection.json -e integrationTests/variables/devIntegration.postman_environment.json --delay-request 1000 -r teamcity,cli --env-var “username=someusername” --env-var “password=12$123456?#12345” --verbose --bail
Note the change in password below in the request sent by newman:
{
"id": "f2b73f50-f136-47c8-aa13-fc65b7123456",
"name": "Get MyAPI",
"headers": {
"accept": "application/json",
"authorization": "Basic cantpastethishere",
"user-agent": "PostmanRuntime/7.26.0",
"cache-control": "no-cache",
"host": "myhost.host.com",
"accept-encoding": "gzip, deflate, br",
"connection": "keep-alive",
"content-type": "application/x-www-form-urlencoded",
"content-length": 108
},
"method": "POST",
"url": "https://myhost.host.com/my/route",
"data": {
"username": "someusername",
"password": "12?#12345",
}
}