Here is a link to image: https://i.sstatic.net/fIg3R.png
I have local Header manger for each request. I also have Global one. [Please look at the image] I want to remove local Header manager for all requests.
I tried it by creating a preprocessor and writing "sampler.getHeaderManager().removeHeaderNamed("HTTP Header manager");" inside it. But, It's not working. Because of this, It cannot authenticate credentials.
I also tried "sampler.getHeaderManager().remove(0)". This didn't work too. remove(1) ignores the global header manager.
Here is my suggestion. Care must be taken care while following the below steps. I follow this trick to replace dynamic values.
Take a backup of your JMeter script.
Open the script in the notepad++
.
Find the Header Manager tags. It goes something like this
<hashTree><HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"><collectionProp name="HeaderManager.headers"/></HeaderManager><hashTree/>
If you have many Header Manager Name
and its name unique, you can use regular expression
in notepad++.
Reg ex syntax in notepad++
<hashTree><HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="(.+)" enabled="true"><collectionProp name="HeaderManager.headers"/>
</HeaderManager><hashTree/>
empty
value using Find and Replace
. While replacing, please take care of
<hashtree></hashtree>
tags, any conflicts will result in corruption in the script. UseTest Plan Check Tool
plugin to validate your test plan. Please visit this link to know more https://jmeter-plugins.org/wiki/TestPlanCheckTool/