【问题标题】:Can I skip some of the selected "Api Requests" in postman while using it through Newman-Runner-CLI?我可以在通过 Newman-Runner-CLI 使用 postman 时跳过一些选定的“Api 请求”吗?
【发布时间】:2022-01-22 15:06:52
【问题描述】:

作为用户,我有几个使用 postman 创建的 API 集合,现在我已经集成了 Newman-Runner-CLI。

我的问题是,有没有办法从每个集合中跳过一些选定的 API 请求,或者有没有办法在一个文件中添加“跳过的 API 请求”,所以在 Newman-Runner 的执行过程中,它会自动跳过那些添加的请求吗?

提前致谢。

【问题讨论】:

    标签: postman web-api-testing postman-collection-runner postman-testcase postman-newman


    【解决方案1】:

    显然,无法确定一个集合是通过 Postman 还是 Newman 运行的。

    根据这个线程,您可以在执行开始时手动设置一个变量(see Postman forum)。

    然后您可以根据该变量的值使用postman.setNextRequest() 引导执行。见:https://learning.postman.com/docs/running-collections/building-workflows/

    【讨论】:

    • 谢谢,Christian,作为用户,一旦我从 Postman GUI 运行收集,它只会要求我勾选/选择我想要执行的 API 请求。那么,在使用 Newman-Runner 运行相同的集合时,我该如何跳过这些请求?有没有办法做到这一点,或者在其他文件中添加一些忽略 API 请求?
    • 只需阅读我的答案和提供的链接,那里都有解释。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-02-20
    • 2016-04-02
    • 2017-09-08
    • 2018-11-30
    • 2019-01-02
    • 1970-01-01
    相关资源
    最近更新 更多