作者:妞妞盼寒假_197 | 来源:互联网 | 2023-09-07 11:24
IwanttoassertthevalueofapropertyinJsonresponsewiththeuseofGroovyscriptinSoapUI.I
I want to assert the value of a property in Json
response with the use of Groovy script in SoapUI
. I know a value for name but I need to know on which position the id is.
我想在SoapUI中使用Groovy脚本断言Json响应中的属性值。我知道名称的值,但我需要知道id的位置。
json response example:
json响应示例:
{
"names":[
{
"id":1,
"name":"Ted"
},
{
"id":2,
"name":"Ray"
},
{
"id":3,
"name":"Kev"
}
]
}
Let's say I know that there is a name Ray, I want the position and the id (names[1].id)
假设我知道有一个名字Ray,我想要的位置和id(名称[1] .id)
1 个解决方案