Rejo Romeo
Rejo Romeo

Reputation: 23

How to pass a value from one http request to another in jmeter

I am new with Jmeter Testing and upon integrating my APIs, I have come across a situation where I need to pass an http request details which is a token to another request section. How can I achieve this?

The response that I got is a Token and I want to use the same token to another apis. Basically it is about setting the environment variables like we are doing with the postman. I am not sure how I can achieve this with Jmeter. Please let me know your thoughts?

Sas token is generated and want to use the same token in the next request header

Upvotes: 2

Views: 4522

Answers (1)

sunny_teo
sunny_teo

Reputation: 1999

Please check, if you need the authorization value from previous request and the value is dynamic.

  1. Use regular expression post processor to fetch the value.

a. Below is the value need to be fetched. enter image description here b. Use Regular expression extractor to fetch the value from request headers. enter image description here 2. Pass the captured value to next request.

a. Pass the capture value to the next request as show below:- enter image description here b. Output verification in view result tree. enter image description here

Once you have the value, use it as per your requirement. I have used in response body just for the demo purpose. Hope this helps.

Upvotes: 2

Related Questions