Reputation: 1149
I am looking for a way to use headers at Jmeter from centralized location. Currently i am using like:
Where "HTTP Header Manager" is Embedded in every single call.
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
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.
Upvotes: 2
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