Search code examples
arraysjsonjmeterbeanshell

Jmeter extract a value using BeanShell PostProcessor


I want to extract b from the following response and use it as a parameter for a new request, can you help me?

Response:

[[
{"a": { "x": "123", "y": "456", "z": "789" }, "p": ["111"], "q": "222"},
"b"
]]

Solution

  • No need for Beanshell here.

    Use JMeter 3.0 JSON Path Post Processor with following JSON Path Expression:

    $..[1]

    See this plan:

    enter image description here

    Syntax is described here: