如何提取数组List中某个值所在的数中的,另一个值

取lineid ="h52yr54bpm9rm1m58x5va4vuhp11pu40"的,数组中的status值

Response data:

[
  {
    "lineId": "zy9aj3tnyuxufj2xqj1ljpa06blwa4d8",
    "name": "41zc6",
    "plantName": "默认工厂(Default Plant)",
    "plantId": "09e992fd9c534b6cac92aa37bb596c89",
    "configChanged": false,
    "mtNum": 8,
    "displayName": null,
    "publishTime": null,
    "status": 0,
    "description": null
  },
  {
    "lineId": "h52yr54bpm9rm1m58x5va4vuhp11pu40",
    "name": "cd102box",
    "plantName": "默认工厂(Default Plant)",
    "plantId": "09e992fd9c534b6cac92aa37bb596c89",
    "configChanged": false,
    "mtNum": 5,
    "displayName": null,
    "publishTime": null,
    "status": 0,
    "description": "cd102boxdescr"
  }
]

 

用 JSON Extractor 

$.[?(@.lineId=="${lineid}")].status

$.[?(@.lineId=="h52yr54bpm9rm1m58x5va4vuhp11pu40")].status

这个表达式的意思就是 取当前数组中的lineId = ${lineId}的数据,其属性status对应的值

"name":"41zc6","plantName":"(.+?)","plantId":"(.+?)","configChanged":(.+?),"mtNum":(.+?),"displayName":(.+?),"publishTime":(.+?),"status":(.+?),

$7$

如何提取数组List中某个值所在的数中的,另一个值_第1张图片

如何提取数组List中某个值所在的数中的,另一个值_第2张图片

如何提取数组List中某个值所在的数中的,另一个值_第3张图片

参考:

https://www.cnblogs.com/yuhuiqing/p/11784265.html

https://blog.csdn.net/haiou24/article/details/83417952

https://www.cnblogs.com/dinghanhua/p/9823305.html

你可能感兴趣的:(Jenkins#JMeter,JMeter)