一、postman断言
(1) Postman中加入断言:Postman通过tests进行断言的插入
自己写格式如下:
tests[“Response time is less than 200 ms”]=responseTime < 200;
tests[“status code”]=responseCode.code===200;
自动生成:
在右侧找适合的
(2) 查看断言执行结果
如果断言执行是通过的,就会显示为PASS,否则就会显示失败
二、生成并导出接口脚本(python版本)
postman支持的脚本类型
通过postman界面处的code按钮,可以选择Postman生成的接口测试脚本。