【发布时间】:2020-03-11 07:47:10
【问题描述】:
我的 JSON 响应是:
{
"results": [
{
"attributes": [
{
"format": "internal",
"name": "resourceid",
"type": "STRING",
"value": "56B15190000015E85E57923F0000033B"
},
{
"format": "attribute",
"name": "ds6w:identifier",
"type": "string",
"value": "ald7_al"
}
]
},
{
"attributes": [
{
"format": "internal",
"name": "resourceid",
"type": "STRING",
"value": "56B15190000015E85E578B1F000001B6"
},
{
"format": "attribute",
"name": "ds6w:identifier",
"type": "string",
"value": "fbh1"
}
]
},
{
"attributes": [
{
"format": "internal",
"name": "resourceid",
"type": "STRING",
"value": "56B15190000015E85E578F7800000211"
},
{
"format": "attribute",
"name": "ds6w:identifier",
"type": "string",
"value": "u89cf"
}
]
}
]
}
我想得到 '56B15190000015E85E57923F0000033B' 其中 value='ald7_al'
所以基本上在一个 jsonarray 中我有 jsonobjects,对于单个 jsonobject 我有两个 jsonobjects,其中 secong jsonobject 将验证我的条件参数,我想要来自第一个 jsonobject 的值
为了获得结果以解决我使用过的条件检查
JSON 提取器表达式为 -> $..attributes[?(@.value==ald7_al)] 这给了我第二个 json 块,但我想要来自第一个 json 块的值。
如果您有任何意见,请帮助我。 提前感谢您的帮助!
【问题讨论】:
-
好像有no way可以访问找到的节点的父节点。
标签: json regex jmeter extractor