Search code examples
postmannewman

Test runs fine in postman but fails in newman. I am running tests after connecting to VPN as 2 APIs among 47 only work once connected to VPN


Connected to VPN: Postman runner works fine and shows results but when I execute the same by Newman it throws error.

Disconnect VPN: Newman runner now works fine with same command and collection but this time those 2 APIs which require VPN fails.

How can i solve this network issue causing newman to fail.

Error newman throws is

[errored]
     connect ECONNREFUSED ipaddress:443
 11⠄ JSONError in test-script

Solution

  • I had to setup HTTP proxy before giving the Newman run command and it worked.

    HTTP_PROXY='Give URL:PORT NUMBER' newman run file.json