I am trying to run selenium web driver(Firefox) test cases against a web application which uses NTLM authentication protocol.
I used DesiredCapabilities to update the "network.automatic-ntlm-auth.trusted-uris" value with "http://localhost:8080" in order to avoid the display of the authentication window.
The "network.automatic-ntlm-auth.trusted-uris" value is updated but in browser it is still empty.
Questions:
- How can I set the "network.automatic-ntlm-auth.trusted-uris" value?
- What is the best way to solve this issue?
Please check the Screenshot and the Code below for more details.
Thanks in advance.
public RemoteWebDriver getWebDriverObject(DesiredCapabilities capabilities) {
String os = SystemUtils.IS_OS_WINDOWS ? "windows" : "linux";
System.setProperty("webdriver.gecko.driver", "target/test-classes/selenium_standalone_binaries/" + os + "/marionette/64bit/geckodriver.exe");
FirefoxOptions options = new FirefoxOptions();
// check the "Network.automatic-ntlm-auth.trusted-uris value before update"
System.out.println("Capability before update >>>>>" + capabilities.getCapability("Network.automatic-ntlm-auth.trusted-uris"));
// update the "Network.automatic-ntlm-auth.trusted-uris value" after update
capabilities.setCapability("Network.automatic-ntlm-auth.trusted-uris", "http://localhost:8080");
// check the "Network.automatic-ntlm-auth.trusted-uris value after update"
System.out.println("Capability after update >>>>>" + capabilities.getCapability("Network.automatic-ntlm-auth.trusted-uris"));
options.merge(capabilities);
options.setHeadless(HEADLESS);
return new FirefoxDriver(options);
}