How to build test plan structure to use one Header Manager to all the HTTP Request

321 Views Asked by At

I am working on my test plan in JMeter but I am struggling with passing bearer token to all the requests.

I managed to set bearer as variable and pass it to another request but... I don't want to add a new Header Manager to every new HTTP Request created. Whenever I am trying to use one Header Manager to the whole thread group, the request which is responsible for getting the auth token is failing because it uses the created bearer variable as well.

So summarizing: I want to use one Header Manager for my whole Thread Group. How to structure should look like.

In the attachment, I am adding my current test plan structure.

My current test plan

1

There are 1 best solutions below

1
Dmitri T On BEST ANSWER

Just move the Login /get Token out of the HTTP Header Manager scope

For example add a Simple Controller which does nothing apart from being a container for other test elemements and move your HTTP Header Manager and HTTP Request Samplers there:

Something like:

enter image description here