1
votes

I have a test configured in Jmeter for a HTTP basic auth-protected site. I have an HTTP Authorization Manager configured at the top level with the user/pass for this auth.

There's one http request buried deep in the thread ('Get configurable product options' in the pic below) that I do not want to send the Authorization header with: it's a REST call and I'm sending a bearer Authorization header instead.

I have a HTTP Header Manager assigned to this call with the specific Authorization header defined. All I want is for the Basic Auth header not to be sent, but I cannot for the life of me figure out how.

How do I override this so that the Authorization header set by the HTTP Header Manager overrides the one set by the Authorization Manager?

The 'Get configurable product options' http request needs a different Authorization header to everything else

1

1 Answers

2
votes

As per documentation for the HTTP Authorization Manager (JMeter 5.0)

If there is more than one Authorization Manager in the scope of a Sampler, there is currently no way to specify which one is to be used.

So the only way you can override the Authorization header value is using HTTP Header Manager

  1. Add HTTP Header Manager as a child which header you want to override
  2. Configure it as follows:

    • Name: Authorization
    • Value: ${__base64Encode(username:password,)}

      Replace username and password with your real credentials

Keep in mind that __base64Encode() is a custom JMeter function, if you don't have it already you will need to install it via JMeter Plugins Manager