基本界面展示
Get、Post请求


Postman断言
使用postman来判断预期结果与实际结果是否一致
- 响应状态码断言

- 响应包含字符串

- 断言判断字符串的格式

关联
用于解决http请求之间存在依赖关系
依赖:一个http请求的响应结果中的数据,被另一个请求使用
登录 http请求,返回的令牌。被添加员工请求依赖(请求头中使用),可以使用 postman的关联技术来使用。
适用情况:http请求之间存在依赖关系


- 全局变量
- 环境变量(先创环境)



参数化
参数化:将 http请求需要的数据,和断言数据,组织到一个文件中。从postman导入文件,实现 http请求发送、断言。
应用场景:针对同一个接口,组织 N 条 不同的测试用例。数据格式完全一致的。适用参数化。
文件格式:
- 1.CSV:

- json:


生成测试报告

生成测试报告步骤:
- 批量执行用例集;
- 导出用例集合;
- 终端下使用命令:
newman run 用例集文件.json -e 环境文件.json -d 数据文件.csv/.json -r htmlextra --reporter-htmlextra-export 测试报告名.html
