postman:http接口测试工具 手工测试
postman基本使用
免费的数据接口平台(需实名注册):https://wx.jdcloud.com/api/0_0/1(京东万象)
获取appkey -> 接口地址写入postman的GET -> 填入需要的参数 -> send -> 得到response
变量的定义
如何运行集合测试:
设置集合变量
设置全局变量
设置环境变量
用脚本设置变量:
postman断言
-
Response body:contains string(响应体中是否包含某个内容)√
测试失败:
-
Response body:is equal to a string(响应体是否等于某个字符串)
-
Response body:json value check(响应体检测某个json值)√
-
Response header:content-type header check(检验响应头是否包含)
是否有权限认证等信息 -
Response time is less than 200ms(响应时间小于200ms)
看性能 -
Status code:code is 200(判断响应码是否是200)
只能判断请求是否成功,不能判断数据是否有问题
postman参数化
编写一个csv文件:
postman随机数
- {{$guid}}
- {{$timestamp}} 时间戳
- {{$randomInt}} 随机数0~1000