Load Testing RestFul Api , one time authorization

Viewed 348

I need to test wheather API is working or not and also to put load on each of them .

In post man I can do this but how to get it on jmeter.

I have an POST request from where i get access_tokken , then copy this token and put it in other API Header to get response from API .

Here is request json to get access :

Response 201 (application/json)Body  {
      "token_type":  "Bearer",
      "expires_in" : 3600,
      "access_token" : "generated_access_token"
  }

When run I am getting :

{"token_type":"Bearer","expires_in":3599,"access_token":"accesstoken value here"}

Need to get this access_token and pass it to other POST body to get reponse .

2 Answers

Firstly you extract access token to variable JSON Extractor

Then you use this variable in proper header in other request/requests enter image description here

Related