本文介绍了如何获取 Postman Environment 和 Postman Globals URL 以传递给 Newman?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Newman 帮助指定集合、环境和全局变量可以作为路径或 URL 传递.我可以看到如何从 Postman 获取收藏 URL(通过转到共享">收藏链接").
如何在 Postman 中获取 Environment 和 Globals 的 URL,以便将它们传递给 newman?
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?
推荐答案
将 Newman 与 Postman Pro API 结合使用:
Using Newman with the Postman Pro API:
- 生成 API 密钥
- 从以下位置获取您的收藏列表:
- Generate an API key
- Fetch a list of your collections from:
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"
这篇关于如何获取 Postman Environment 和 Postman Globals URL 以传递给 Newman?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!