postman生成html文档,postman-使用newman生成html测试报告

一、安装好node.js

二、安装newman和html

2、cmd输入 npm install newman-reporter-html  安装html

052bd966a45895c3932f82b2df251d15.png

三、第在postman内保存接口并导出为json格式文件,找个路径存放

导出接口 ,如果有变量的话 也要把变量一起导出

6d71cc01c1abd88ffb39f5af02e1aaa8.png

导出变量

c35576be615965ae83c94f5e5eb5a11d.png      

19c7160e0b3daad27ef613f32555cf91.png

四、执行命令生成html报告

newman run E:\postman_json\data.json -g E:\postman_globals\globals.json -d E:\csv\csvdata.csv --reporters html --reporter-html-export E:\report\html02.html

ecde306c55fdac8feed36aee727c8537.png

问题:

1.配置npm的全局模块的存放路径、cache的路径时,执行命令npm config set prefix "D:\Program Files\nodejs\node_global"后系统无响应,不是加载的那种状态,而是下标不停地在哪里闪

解决:C:\Users\{账户}\下的.npmrc文件删除掉,就可以重新使用了

2.执行以上生成html报告的命令时,若出现异常提示:

newman: "html" reporter could not be loaded.

run `npm install newman-reporter-html`

解决:需要执行命令 npm install -g newman-reporter-html  来全局安装支持Newman生成html报告的组件然后,

再次执行命令  newman run E:\postman_json\data.json -g E:\postman_globals\globals.json -d E:\csv\csvdata.csv --reporters html --reporter-html-export E:\report\html02.html

成功~

ee466f38d307eaaa04c7938720e59fbc.png

五、查看测试报告~~

0f85f62e306dbc9e935757421f7600ff.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值