安装和配置
安装node.js
验证:node.js是否安装成功
安装newman:npm install -g newman
配置newman环境:
验证:newman是否安装成功
newman的命令
常见的参数
-e: 使用环境变量
-g: 使用全局变量
-d: 使用csv,text,json数据驱动
-n:循环次数
-r :cli,html,json,junit --reporter-html-export
命令:
newman run C:\Users\jack\Desktop\postman_collection.json
生成测试报告
首先下载 html:npm install -g newman-reporter-html
newman run C:\Users\jack\Desktop\postman_collection.json -r html --reporter-html-export report123.html