0

It seems to me there is no solution for this, but I will still ask to see if anyone can help me.

I'm trying to use Newman to run my Postman collection, but I have a problem. Newman doesn't seems to be able to use Collection Variables. I've encountered this error while trying it:

getaddrinfo ENOTFOUND {{baseUrl}}

This is because I use the variable {{baseUrl}} to define my base url without needing to repeat it.

"variable": [
  {
    "id": "baseUrl",
    "type": "string",
    "value": "https://dev.sonsy.io/api/v1"
  }
]

And if I hover over the variable in Postman Collection Runner it tells me that the scope of the variable is Collection. I would like to keep using collection variables instead of creating an Environment or Global Variables.

Is there any work around? Could it be that my Collection is wrongly structured for Newman? It works just fine in the Postman Collection Runner.

Thank you and good coding ;)

Gabriel
  • 13
  • 4
  • Your reference and the variable name are different. The variable is `baseUrl` and you're referencing `{{baseurl}}` – Danny Dainton Aug 25 '20 at 21:26
  • @DannyDainton Thanks for your comment :) But it was a typo error mine in the question, updated. It had nothing to do with what I'm experiencing. – Gabriel Aug 26 '20 at 10:08
  • You may need to expand on the details of the question. Show an image of what you can see, log the `baseurl` variable out to the console to see what is actually getting picked up for the run, ensure that you don't have any unsaved changes, check that you don't have variables of the same name at different scopes. The details you provided are missing certain contextual information here. – Danny Dainton Aug 26 '20 at 10:22
  • What's the Newman command you're using? If it's an exported file, make sure that the variable is set in the initial and current value - If it's in the current, it won't be exported with the file. – Danny Dainton Aug 26 '20 at 10:25
  • Does this answer your question? [Node.js getaddrinfo ENOTFOUND](https://stackoverflow.com/questions/17690803/node-js-getaddrinfo-enotfound) – Henke Feb 02 '21 at 12:19
  • Also - https://stackoverflow.com/q/23259697. (https://stackoverflow.com/q/34802333?) – Henke Feb 02 '21 at 12:42

1 Answers1

0

Update your Collection variable's Initial Value with there Current Value. Newman only takes Initial values from Collection Variables.