【问题标题】:how to have 2 output of newman with single execution如何通过单次执行获得 2 个 newman 输出
【发布时间】:2021-05-20 02:14:11
【问题描述】:

鉴于以下情况:

使用newman执行采集,并保存在reportfile中,同时也将newman的标准输出放上来,方便我们查看。 (就像正常执行一样,不保存到任何报告文件中)。

所以我的问题是当使用选项将 newman 执行保存到报告文件时,它似乎重定向标准输出并将其转换为报告文件。在此执行期间,我在标准输出中什么也看不到。

到目前为止,我可以分两步完成,这似乎有点不专业。

内部: 执行PostmanCollection.ps1 ... 新人运行 $collection -e $env --insecure -r junitfull --reporter-junitfull-export $result ...
新人运行 $collection -e $env --insecure --disable-unicode |输出文件 -FilePath "./output.txt" 获取内容“./output.txt”

谢谢你 问候 CP

【问题讨论】:

  • 您可以在一个命令中使用多个报告器。例如,要从同一运行中获取 junitfull 和 json 输出,只需添加 -r junitfull,json
  • 谢谢@DannyDainton 成功了!

标签: postman newman


【解决方案1】:

使用 cli 报告器。

newman run $collection -e $env --insecure -r cli,junitfull --reporter-junitfull-export $result ...
newman run $collection -e $env --insecure -r cli --disable-unicode | Out-File -FilePath "./output.txt" Get-Content "./output.txt"

【讨论】:

  • 谢谢@PDHide,它就像一个魅力!
猜你喜欢
  • 2018-04-20
  • 2018-05-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-09-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多