我是Postman的新手,我正在尝试为GET编写自动验证
我在DB中保存了多个记录,我需要在Postman中编写一个自动化脚本来验证GET只会带来具有code1&的“帐户”。 code2在一个记录中,如下例所示
"account": [
{ {
"system":" 'system1",
"code": "code1"
},
{
"system": "sytem1",
"code": "code2"
}]
Tried var obj = responseData.entry[i];
tests["Specialty"]= obj.account[0].code === "code1"&"code2";
and it is not working
答案 0 :(得分:0)
你可以试试这个:
var obj = responseData.entry[i];
var account;
if (obj.account[0].code === "code1" && obj.account[1].code = "code2"){
account = obj.account;
}
tests["Specialty", account] = true;
希望这有帮助