我想拉出href的值,其中id : 923使用JSON提取器for Jmeter。
我试过了
$..entries[?(@.id == '923')].links[0].href
但它并没有起作用。我应该如何通过id获取这些值?
下面是一些示例数据。
"entries":[{
"id":"921",
"updated":"9999-12-31T23:59:59.999Z",
"links":[{
"href":"url1",
"rel":"related-action",
"title":"Execute related action"
},{
"href":"url2",
"rel":"icon"
}
]
},{
"id":"922",
"updated":"9999-12-31T23:59:59.999Z",
"links":[{
"href":"url3",
"rel":"related-action",
"title":"Execute action"
},{
"href":"url4",
"rel":"icon"
}
]
},{
"id":"923",
"updated":"9999-12-31T23:59:59.999Z",
"links":[{
"href":"url5",
"rel":"related-action",
"title":"Execute action"
},{
"href":"url6",
"rel":"icon"
}
]
}
]发布于 2015-08-18 20:30:35
JSON?( JSON 923).links.href
{}字符将其括起来,以便@.id == Path Extractor可以使用它。目前,
参考文献:
https://stackoverflow.com/questions/32054525
复制相似问题