我尝试验证这个响应数据
{
"id": "1",
"name": "Rahul",
"location": "noida",
"phone": "1234567890",
"courses": [
"java",
"selenium"
]
}
为了测试我运行这个-
const jsonData=pm.response.json();
pm.test("Test Data Type of the response",()=>{ pm.expect(jsonData.id).to.be.a('integer');});
我得到了结果-
Test Data Type of the response | AssertionError: expected '1' to be an integer