You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

请求协助:使用JSON Extractor按规则捕获指定GUID

使用JMeter JSON Extractor多条件捕获GUID

规则1:匹配指定OrderNumber值

当响应中OrderNumber.value为"J-40-000093-VAN0001"时,提取对应GUID的JSON Path表达式:

$..[?(@.OrderNumber.value == 'J-40-000093-VAN0001')].guid.value

提示:如果OrderNumber和guid处于固定层级而非嵌套数组,可去掉..递归符,直接写对应路径(比如结构为$.[0].OrderNumber.value时,用$.[?(@.OrderNumber.value == 'xxx')].guid.value)。

规则2:匹配NativeMobile下的双字段组合

当NativeMobile.OrderItem_Order.value为"26177172834105120"且NativeMobile.OrderItem_CustomerProduct.value为"28710447624498114"时,提取对应GUID的JSON Path表达式:

$..[?(@.NativeMobile.OrderItem_Order.value == '26177172834105120' && @.NativeMobile.OrderItem_CustomerProduct.value == '28710447624498114')].guid.value

配置说明

在JMeter的JSON Extractor组件中:

  • 将上述表达式分别填入JSON Path expressions输入框(可同时添加多个表达式,对应多个变量)
  • 在Names of created variables中设置变量名(比如guid_order、guid_product)
  • 若需要捕获多个匹配结果,可调整**Match No.**参数(0为随机,-1为全部)

内容的提问来源于stack exchange,提问作者user41456

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.03 11:25:33