Ethon

为什么要有方法,因为懒惰是一种美德。

   :: 首页  :: 新随笔  ::  ::  :: 管理

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中导出测试用例集

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

 

 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
 

 

 

 

 

posted on 2019-09-27 16:41  Ethon  阅读(1149)  评论(0编辑  收藏  举报