报错描述:
postman集合测试,通过newman命令执行postman集合。
运行命令:newman run Postman_API.postman_collection.json -d data.json -r html,报错newman: could not find “html” reporter,如下图所示:
提示:newman: could not find "html" reporter
ensure that the reporter is installed in the same directory as newman
run `npm install newman-reporter-html`
解决方式:
需要安装newman-reporter-html,安装运行命令:npm install -g newman-reporter-html

C:\Users\Administrator\Desktop\pmtest>npm install -g newman-reporter-html
npm WARN newman-reporter-html@1.0.5 requires a peer of newman@4 but none is installed. You must install peer dependencies yourself.
安装完成,重新运行命令:newman run Postman_API.postman_collection.json -d data.json -r html,报告导出成功。
本文介绍了解决在使用Newman执行Postman集合测试时遇到的HTML报告生成问题的方法。当运行Newman命令时,若出现找不到HTML报告器的错误,需要全局安装newman-reporter-html模块。安装完成后,即可成功生成HTML格式的测试报告。
4398





