Postman + Newman 生成测试报告

1.安装Node.js 

下载地址: https://nodejs.org/download/

2.安装Newman

1) 打开cmd,输入:npm install -g newman

2) 安装支持Newman生成html报告的组件

npm install -g newman-reporter-html
 

3.postman中导出测试用例集

注意:需postman中导出测试用例集

 如果设置了环境变量,则需导出环境变量数据

扫描二维码关注公众号,回复: 7377065 查看本文章

 4.newman中执行测试用例

newman run f:\esearch.json -r html --reporter-html -export f:\result.html
注意: f:\ esearch.json为postman中导出的测试用例集, f:\result.html为导出的测试报告
 
如果设置有环境变量,则执行
newman run f:\esearch.json -e f:\es.json -k -r html --reporter-html -export f:\result.html
注意: f:\es.json为导出的环境变量文件
 
5.生成测试报告如下 result.html
 
 

猜你喜欢

转载自www.cnblogs.com/wakey/p/11598874.html