我想使用Jmeter提取器为Jmeter提取id : 923
的href值。
我试过了,
$..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"
}
]
}
]
答案 0 :(得分:0)
尝试删除引号,以便您的JSON路径表达式如下所示:
$..entries[?(@.id == 923)].links[0].href
{}
字符将其包围,以便JSON Path Extractor可以使用它。 参考文献: