一、postman下载安装
二、postman 发送请求
1.发送get请求
2.发送post请求
https://www.cnblogs.com/shimh/p/6093229.html
三、postman全局变量配置
四、postman环境变量配置
五、批量执行测试用例
六、postman+newman生成测试报告
1.下载node.js 官网
把node.exe的目录加入到环境变量中。假设node.exe位于 C:\nodejs\node.exe。那么将E:\nodejs 加入到环境变量即可。打开cmd,输入node,如果没有报错,而是显示“>”,说明node安装成功。
2.下载newman:
打开cmd输入
npm install -g newman
再安装html
npm install -g newman-reporter-html
3.newman使用:
在postman里面export出接口,格式选择V2.1
4、运行测试用例(参考https://www.cnblogs.com/echoqi/p/10264860.html)
执行测试用例集:newman run 接口
例如:run /Users/jww/Downloads/华泰-API.postman_collection.json
指定生成报告的位置:r html --reporter-html-export 文件保存路径
例如:newman run /Users/jww/Downloads/华泰-API.postman_collection.json -r html --reporter-html-export /Users/jww/Desktop/JWW
加上环境变量-e
例如:newman run /Users/jww/Downloads/华泰-测试1.postman_collection.json -e /Users/jww/Downloads/htxd2test.moguyun.com.postman_environment.json -r html --reporter-html-export /Users/jww/Desktop/JWW
设置全局变量 -g
例如:newman run test.postman_collection.json -e test.postman_environment.json -g C:\Users\test.postman_global.json >d://error1.log