在 JMeter 中,当我尝试使用 JSON Extractor 传递值时,仅传递默认值

In JMeter when I try to pass a value using JSON Extractor only the default value is passed

我的 JMeter 脚本似乎只想将默认值从 JSON 提取器传递到下一个调用。我认为问题可能出在我的表达上。

响应 JSON 看起来像这样:

{"userAssociations":[{"id":"1","userAssociationRole":"ACCOUNTHOLDER","userAssociationMechanism":"USER-DATAENTRY","userAssociationStatus":"ACTIVE","accountHolderAssociationStatus":"ACTIVE","accountHolder":{"id":"2","givenName":"Perf","familyName":"Test1"},"issuer":{"id":"1","name":"A College","localeId":"en-US"}}],"operation":{"result":"OK","errors":[],"requestTimeStampUtc":"2017-09-27T21:32:59.327Z","responseTimeStampUtc":"2017-09-27T21:32:59.345Z"}}

这里的想法是,我希望在下一次调用的URL中传递第二个"id" =2。但是我只能获得默认值作为变量传递给下一个调用。

你JSON路径应该是:

$.userAssociations[0].accountHolder.id

匹配号应为 1

参见: