使用apipost参数化和断言的时候,需要进行参数定位。
参数化的时候定位token

接口测试--apipost参数定位-LMLPHP

token在响应中的位置为response.json.data.token,我们用console.log打印token的值

接口测试--apipost参数定位-LMLPHP

如何定位包含在数组中的参数,定位name这个值

接口测试--apipost参数定位-LMLPHP

定位数组需要定位它是数组的第几个值从0开始,response.json.data.test[0].name,response.json.data.test[1].name

接口测试--apipost参数定位-LMLPHP

04-07 09:49