but the same collection failed only in submit folder, which the first test return â401 Unauthorizedâ, the other 3 return âTypeError cannot read infoâ
Iâve tried to follow solution similar to my question, which to add the environment variable to the newman run script ââenv-var =â, but this doesnât fix the issueâŚ
What is the newman command you are running in CMD?
You are getting a 401 unauthorised error, I suspect this is because you are not passing the API key with the run command.
You may need to do some research on this one. Thereâs many ways to handle sensitive information locally while running Newman, but be careful not to expose your secrets in your public workspace.
^^ In the client when you run it should be grabbing the API key you have set from the âcurrentâ variables column. For security reasons this column is not exported.
You would need to pass the API key into the run command;
newman run "Day 13- Newman.postman_collection.json" --env-var "collectionUid=myCollectionUid"
yup, your suggestion actually fix only the first issue with 401 unauthorized, but I still got 3 errors saying âcannot read infoâ, which this info is the key from response body