vlatko606
vlatko606

Reputation: 1149

Jmeter - Headers from centralized location

I am looking for a way to use headers at Jmeter from centralized location. Currently i am using like:

enter image description here

Where "HTTP Header Manager" is Embedded in every single call.

enter image description here

But, i don't find this usage very good, especially if some change is done, i need to change every single call.

Is there any way i can create centralized 'method', so i can call in every single call, rather than 'Hard coding' them?

Upvotes: 0

Views: 48

Answers (2)

Dmitri T
Dmitri T

Reputation: 168082

HTTP Header Manager (as well as other Configuration Elements, Pre-Processors, Post-Processors, Timers, Assertions and Listeners) obey JMeter Scoping Rules therefore it is enough to put the HTTP Header Manager at the same level as all the Samplers and the header(s) defined there will be applied to all of them.

If you want to override the particular header - add another HTTP Header Manager as the child of this or that particular Sampler and the header will be overwritten for this request.

enter image description here

Upvotes: 2

Ori Marko
Ori Marko

Reputation: 58772

You can put Header Manager in same level of requests and it will effect all requests in same hierarchy

JMeter now supports multiple Header Managers. The header entries are merged to form the list for the sampler. If an entry to be merged matches an existing header name, it replaces the previous entry. This allows one to set up a default set of headers, and apply adjustments to particular samplers. Note that an empty value for a header does not remove an existing header, it justs replace its value.

Upvotes: 0

Related Questions