0
votes

I am a beginner in JMeter, trying to perform load test to my Rest API. First, the Get request gets the access_token as below:

enter image description here

Then the following Post request runs with that authorization token to produce the Json, but I am missing something so the Post Request is failing as Authentication denied as below,

enter image description here

Added the Regular expression extractor to extract the token from the Get request's response as below:

enter image description here

Then storing it in the HTTP Header Manager in a variable as below

enter image description here

I am missing to link the value to the Post request, I dont know how to do it, please help.

1
Tried, but didn't work - Satheesh47

1 Answers

1
votes

In header manager, instead of access_token, the header name should be Authorization. Please reconfirm this with developer team / retry this same request in postman

The regex expression used should look something like this "access_token":"(.*?)"

Also, another pro tip: because the response to getToken api call is JSON, you can use JSON Post Processor to extract the access_token by saying something like $.access_token. It is much clean way to process JSON object.

enter image description here