问题描述 投票:0回答:1
pm.test("Id includes a number", function () { var jsonData = pm.response.json(); pm.expect(jsonData.id).to.include(Number); }); var jsonData = pm.response.json(); pm.test("Text check", function () { pm.expect(jsonData.text).is.to.equal(parseInt()); });

您的响应数据是数组,它启动了

[

并结束了

]

因此,您需要通过索引访问项目,然后可以通过键访问内容。
this console.log()可以帮助弄清楚它。
testing automated-tests postman numbers
1个回答
0
投票


	

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.