美文网首页
Newman指令

Newman指令

作者: 猿二胖 | 来源:发表于2019-11-08 11:18 被阅读0次
1、查看版本
  • 查看newman当前版本
$ newman -v
2、运行脚本
$ newman run json文件  [options]
  • -e source:用来指定环境变量文件的路径
$ newman run xxx.json -e xxx.postman_environment.json 
  • -g source:用来指定全局变量文件的路径
$ newman run xxx.json -g xxx.postman_globals.json 
  • -d iteration-data: 指定用于迭代的数据源文件路径
$ newman run xxx.json -g xxx.postman_globals.json  -d xxx.txt
  • -n iteration-count :指定迭代次数
$ newman run xxx.json -g xxx.postman_globals.json  -d xxx.txt -n 10
  • –folder folder-name: 如集合下存在文件(前端接口),使用该命名,则只运行集合中前端接口文件下的接口
$ newman run xxx.json -g xxx.postman_globals.json  -d xxx.txt -n 10 -folder xxx
  • -r reporter-name:用来指定产生的数据结果的模型,如json,html等。
$ newman run xxx.json -g xxx.postman_globals.json -r html
  • --reporter-html-export:指定html报告写出的路径
$ newman run xxx.json -g xxx.postman_globals.json --reporter-html-export /Users/xxx/Desktop/result.html
  • –timeout (ms): 设置整个集合运行完成执行的时间
  • –timeport-request (ms): 指定等待请求返回响应的时间
  • –timeout-script (ms):指定等待脚本执行完成的时间

相关文章

网友评论

      本文标题:Newman指令

      本文链接:https://www.haomeiwen.com/subject/ptsibctx.html