Reputation: 217
Newman help specifies that collection, environment and globals can be passed as a path or as a URL. I can see how to get a collection URL from Postman (by going to Share > Collection Link).
How can I get the URLs to Environment and Globals in Postman, so I could pass them to newman?
Upvotes: 6
Views: 6210
Reputation: 1
This question is still relevant, since now the API key is passed to the header, and now you can't just copy the url and paste it into newman.
Update: The issue has been resolved, now you need to add a new parameter to the newman command --postman-api-key [api-key]
Upvotes: 0
Reputation: 5
I didn't get that how to get Postman Globals URLs for passing to Newman? I am only able to get the collection and Environment URL.
Upvotes: 0
Reputation: 121
Using Newman with the Postman Pro API:
https://api.getpostman.com/collections?apikey=$apiKey
https://api.getpostman.com/collections/$uid?apikey=$apiKey
https://api.getpostman.com/environments?apikey=$apiKey
newman run "https://api.getpostman.com/collections/$uid?apikey=$apiKey" \
--environment "https://api.getpostman.com/environments/$uid?apikey=$apiKey"
Upvotes: 11
Reputation: 1987
via Postman, I exported my environment as a json file, and then hosted that file on a webserver.
Upvotes: 0
Reputation: 4701
Using the Postman desktop app please try the following steps -
View in Web
.Upvotes: 2
Reputation: 386
From the command line, use the newman command line options:
-e <source>, --environment <source>
Specify an environment file path or URL. Environments provide a set
of variables that one can use within collections. Read More
-g <source>, --globals <source>
Specify file path or URL for global variables. Global variables are
similar to environment variables but has a lower precedence and can
be overridden by environment variables having same name.
If you use newman as a Node JS module, provide environment and global as options to newman.run():
newman.run({environment: <source>, globals: <source>}, callback)
Upvotes: -4