I have used Json Path Extractor to extract value of Cid. The value is 1034.

When I pass this variable to next HTTP request it goes like [1034].

My question is, how to remove these [] square brackets and pass only the numeric value to the next HTTP Request?

2 Answers 2

  1. If you're using JSON Path Extractor here are the options:

    • add [0] to your JSON Path query
    • access extracted value as ${Cid_1} (given you use Cid as a "Reference Name"

See "JSON Arrays" chapter of the Advanced Usage of the JSON Path Extractor in JMeter guide for details

  1. If you're using JSON Path PostProcessor you can control the match group via "Match Numbers" input.

You can see resulting variable(s) values using Debug Sampler and View Results Tree listener combination.

JSON Path View Results Tree


In Jmeter 4.0 version its okay to use $..token_id, but in Jmeter 2.x version we need to use $.token_id

i.e, there should be only one dot(.) after $,

I faced the issue and now its working.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.