Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSON Path Extractor in JMeter

Tags:

jmeter

I am new to jmeter. Can anyone help me to use a response object of one request to be passed as a request header of next HTTP request ?

Let me explain.

  1. I am getting an access token along with the response of login in my app:

    {: "responseCode":18, : "message":"Successfully logged in.", : "responseObject":"8zWExE4eSdhcJDwnW9MgIw=="}

  2. No I want to use this access token (8zWExE4eSdhcJDwnW9MgIw) as one of the parameter of next request.

I used JSON Path Extractor for this.But its not working.

like image 579
fms Avatar asked Jul 08 '26 00:07

fms


1 Answers

I am using JSON Path Extractor as well and it works great if it is properly configured. Just put it into request and fill fields:

  • Variable Name: access_token (or any other you want to use later in request like this ${access_token})
  • JSON Path: responseObject should be enough if the JSON you pasted is full response (thjose additional colons are just some mistakes when copy-pasting or the JSON is corrupted?)
  • Default Value: I always use some value like 'NotUpdated!' here so I can assert in the next step or at least see it easily in request.
like image 144
Faflok Avatar answered Jul 13 '26 15:07

Faflok