Use JMeter Webdriver (Plugin Selenium) to make HTTP Header Manager and see results in Dynatrace Use JMeter Webdriver (Plugin Selenium) to make HTTP Header Manager and see results in Dynatrace selenium selenium

Use JMeter Webdriver (Plugin Selenium) to make HTTP Header Manager and see results in Dynatrace


  1. WebDriver Sampler doesn't respect HTTP Header Manager
  2. WebDriver itself doesn't support working with HTTP Headers and the feature is unlikely to be implemented ever

So the options are in:

  1. Use an extension like ModHeader, but in this case you will have so switch from the WebDriver Sampler to JSR223 Sampler. Example code:

    def options = new org.openqa.selenium.chrome.ChromeOptions()options.addExtensions(new File('/path/to/modheaders.crx'))def capabilities = new org.openqa.selenium.remote.DesiredCapabilities()capabilities.setCapability(org.openqa.selenium.chrome.ChromeOptions.CAPABILITY, options)def driver = new org.openqa.selenium.chrome.ChromeDriver(capabilities)driver.get('http://example.com')
  2. Use a proxy like BrowserMob as the proxy for the WebDriver and configure it to add headers to each intercepted request. Example initialization code (you can put it into the aformentioned JSR223 Sampler somewhere in setUp Thread Group)

    def proxy = new net.lightbody.bmp.BrowserMobProxyServer()def proxyPort = 8080proxy.setTrustAllServers(true)proxy.addRequestFilter((request, contents, info) -> {    request.headers().add('your header name', 'your header value')    return null})proxy.start(proxyPort)