6
votes

I have a large and deep test and am using jmeter 2.1.3.

I have a default http header manager at the top level and inherited for all the samplers below.

Deep in the test structure i need to make an http request and remove all the headers inherited from the parent manager.

The docs say this is achieved by creating a child manager for this sample and declaring the header with a null value, however this just sends a null value over the air and doesnt strip the header completely from the request.

Any ideas? I really dont want to create a child manager for every sample just to over come this issue as im often tweaking the values to 99% of the samples

3
Hi,Are you really using 2.1.3 or 2.13 , if 2.1.3 you should urgently upgrade. Regarding the null value, where did you read this in documentation ? Thanks - UBIK LOAD PACK

3 Answers

9
votes

Found a cool way to sort it, as i just couldn't get the header manager to do what i think its meant to from the docs. I added a BeanShell PreProcessor to the sampler i didn't want an inherited header to be used at all with the following:

import org.apache.jmeter.protocol.http.control.Header;

sampler.getHeaderManager().removeHeaderNamed("Authorization");

1
votes

In your header manager at the top level, you could set the values as a variable, then later change that variable in a beanshell script.

0
votes

Or else you can use add bean shell postprocessor add the below code

import org.apache.jmeter.protocol.http.control.Header;
sampler.getHeaderManager().remove(1);

for more details refer http://jmeterblogb.blogspot.in/