
Steps to reproduce the problem:
@debjchak you can disable SSL verification check and allow self-signed SSL certificate by using --insecure flag.
JSONError is because of pm.response.json() in test script tries to JSON parse response body but the request is failed because of SSL verification first.
To use global variables you need to specify them like --global-var "url=http://localhost".
Check all the available Newman options here.
Hi Udit,
Since I am completely new to Postman and Newman, I really do not know how
to execute the solutions you provided.Could you please elaborate a bit to
explain how to I run the command to allow self signed SSL certificate by
using the insecure flag?
Also, i need to know how to use --global-var "url=http://localhost"?Should
I just type this in before running my collection in Command Prompt ?
@debjchak you can use the above mentioned options like this:
newman run https://www.getpostman.com/collections/e20dc7daa589e7dd2a22 --insecure --global-var "url=http://localhost"
You can know more about using Postman and Newman from the following documentations:
Hi Udit,
Thanks for your quick response. The issue I am facing now is with global
variables. Everything works as expected if I do not use Global variables
in my url. but the moment I use them, i get the following error. Please
suggest.
@debjchak Can you specify the error and Newman command used?
Hi,
The errors I receive are
@debjchak I see that you updated the request URL to {{url}}/applyUPUI.
Now using --global-var "<global-variable-name>=<global-variable-value>" option, you can replace the {{url}}(global-variable-name) with the required requesl URL(global-variable-value).
The above error is because you used --global-var "url=http://localhost" directly from my previous example, here you need to change http://localhost with your request URL https://10.144.3.... (as seen in the screenshot above).
Below is my command for which I still receive error stating "Invalid URI".
newman run https://www.getpostman.com/collections/e20dc7daa589e7dd2a22 --insecure --global-var
newman run https://www.getpostman.com/collections/e20dc7daa589e7dd2a22 --insecure --global-var

@debjchak You are missing global-variable-name i.e url in you case. It should be:
newman run https://www.getpostman.com/collections/e20dc7daa589e7dd2a22 --insecure --global-var "url=https://10.144.31.156/apic-dev/sb/primaryrepository/api/productmovements"
The Global variable name got hidden some how. Rectified now.All work as expected. Thank you so much for the quick responses and resolution.

Newman version 4.5.6
Postman-win64-7.10.0
node version 6.10.0
Created Collection
AuthLogin - Pre-request Script with json stored in variable and set the variable in environment to use it in body, wrote two test test in test.
Then exported collection v2.1 and saved this file as postman collection

and also saved environment variables
and ran newman on cmd - newman run AutomationScript.postman_collection -e STG.postman_environment.json
Most helpful comment
@debjchak you can disable SSL verification check and allow self-signed SSL certificate by using
--insecureflag.JSONErroris because ofpm.response.json()in test script tries to JSON parse response body but the request is failed because of SSL verification first.To use
global variablesyou need to specify them like--global-var "url=http://localhost".Check all the available Newman options here.