接口测试自动化测试 怎么把上一个接口的输出做为下一个接口的输入呢?
python selenium 做接口测试自动化测试 怎么把上一个接口的输出做为下一个接口的输入呢?这水贴? 用request库
def xx(self):
with requests.post(url=url, json=data, headers=self.header) as response:
responses = response.json()
sessionid=responses['data']['identifier']['sessionId']
return sessionid
存为变量 存为变量 变量存储,继续使用 存变量,然后下个接口进行使用 def xx(self):
with requests.post(url=url, json=data, headers=self.header) as response:
responses = response.json()
sessionid=responses['data']['identifier']['sessionId']
return sessionid def xx(self):
with requests.post(url=url, json=data, headers=self.header) as response:
responses = response.json()
sessionid=responses['data']['identifier']['sessionId']
return sessionid
页:
[1]