学习 httprunner 接口测试,使用 csv 里的数据时,总是提示找不到变量代码如下
‘’‘- config:
name: testcase description
variables: {}
test:
name: /query
parameters:
- postid1: ${P(postid.csv)}
request:
headers:
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36
X-Requested-With: XMLHttpRequest
method: GET
params:
phone: ''
postid: $postid1
temp: '0.8965555064774655'
type: huitongkuaidi
url: http://www.kuaidi100.com/query
validate:
- eq:
- status_code
- 200
- eq:
- headers.Content-Type
- text/html;charset=UTF-8
’‘’
报错信息如下:
‘httprunner.exceptions.VariableNotFound: postid1’