问题
I'm trying to execute REST Webservice with multiple input from csv file in Postman Runner collection, but in URL param my csv value is not substituting. I followed the same example even that's not working - http://blog.getpostman.com/2014/10/28/using-csv-and-json-files-in-the-postman-collection-runner/
When I generate the report file - I'm seeing the URL request is going like this
_http://dump.getpostman.com/get?username={{username}}&password={{password}}
instead of
_http://dump.getpostman.com/get?username=ankith&password=abc
What I'm missing here, why actual value is not taking from csv file, it would be really appreciated if someone can help me to fix this issue
回答1:
It seems that URL is not getting {{username}} and {{password}}. just make sure that both values are getting stored in environment variable or not. As you are using csv file to read data the following piece of code may help you:
postman.setEnvironmentVariable('username',data['usrName']);//assuming usrName will be column name for username entries in csv file
postman.setEnvironmentVariable('password',data['passwd']);//assuming passwd will be column name for password entries in csv file
You need to write this script in Pre-request Script in postman request. Pre-request Script executes before test case execution
来源:https://stackoverflow.com/questions/39842552/value-not-substiuting-in-postman-runner-collection