{
"success": {
"text": "successfully! deleted Records"
}
}
要验证文本值是否为“成功!已删除的记录”
我尝试过
pm.test("Your test name", function () {
var jsonData = pm.response.json();
pm.expect(jsonData[0].text).to.eql("successfully! deleted Records");
});
答案 0 :(得分:1)
您正在尝试从JSON对象而不是数组中检索数据。因此,应如下所示。
pm.test("Your test name", function () {
var jsonData = pm.response.json();
pm.expect(jsonData.success.text).to.eql("successfully! deleted Records");
});