I am trying to use the Selenium Internet Explorer driver but it is breaking when I try to instantiate it:
[TestInitialize]
public void TestInitialise() {
ieDriver = new InternetExplorerDriver();
}
with the following error:
Enable Protected Mode must be set to the same value (enabled or
disabled) for all zones. (NoSuchDriver).
I have found an apparent solution to my problem here, which suggests setting the driver’s DesiredCapabilities, as shown:
var capabilitiesInternet = new OpenQA.Selenium.Remote.DesiredCapabilities();
capabilitiesInternet.SetCapability("ignoreProtectedModeSettings", true);
IWebDriver webDriver = new InternetExplorerDriver(capabilitiesInternet);
The only problem is, I am using the latest version of the driver that I could find, and there is no override for InternetExplorerDriver that takes DesiredCapabilities as a parameter.
Is there some new or other way of setting DesiredCapabilites now instead of the example that I used?
That setting will work around the problem but introduce some subtle problems. Have you not set up the Protected Modes of IE correctly? This is the correct solution to it.
Guide of this lives here:
https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver
Essentially just turn off protected mode in IE for each zone.
Alternatively if you really must use the override capability, then you either do two things:
Use the
InternetExplorerOptionsclass. Note the name of the property, it gives you a big clue it is not a good idea to use it.or use the RemoteWebDriver, which can take in any implementation of the
ICapabilitiesinterface, whichDesiredCapabilitesimplements: