无法从响应数组中获取值

not able to fetch a value from response array

我有一个响应正文如下。

{ “问题”: [{ "reason": "已发行选定项目", “isSuccess”:真 }] }

我想验证:reason = "SELECTED ITEMS WERE ISSUED" and isSuccess = true.

我试过了:

但总是出现这个错误 javax.script.ScriptException:TypeError:无法在

中获取 属性 “0” of null

非常适合我,将这 3 行粘贴到任何测试中并亲自查看:

* def response = { "issue": [{ "reason": "SELECTED ITEMS WERE ISSUED", "isSuccess": true }] }
* match response.issue[0].reason == 'SELECTED ITEMS WERE ISSUED'
* match response.issue[0].isSuccess == true