NTLM authentication in Selenium RemoteWebDriver NTLM authentication in Selenium RemoteWebDriver selenium selenium

NTLM authentication in Selenium RemoteWebDriver


In order to pass credentials you need to overload the modifyWebClient of the HtmlUnitDriver, as you saw in the discussion link1.

For the .NET developer the only way to use the HtmlUnitDriver is via the RemoteWebDriver, and based on the discussion HtmlUnit wrapper for .NET2 the developers chose not to expose all of the HtmlUnit driver classes:

I'm loathe to take any more dependencies in the .NET bindings... If you're dead-set on using HtmlUnit as your headless browser of choice, you can always use it via the RemoteWebDriver

Therefore you cannot use NTLM, or any other credential method, with the RemoteWebDriver.

If you were willing to do and maintain the work you could convert all the HtmlUnit code as detailed in the second link of @JasonPlutext's answer3.

  1. The original sample appears to be from the selenium FAQ.
  2. Linked to from Is there an HtmlUnitDriver for .NET? here on SO.