1

The IEDriverServer Wiki page has the following listed as a requirement:

On IE 7 or higher on Windows Vista or Windows 7, you must set the Protected Mode settings for each zone to be the same value. The value can be on or off, as long as it is the same for every zone.

Unfortunately, where I work, corporate security policy has the protected mode setting locked down, so I'm unable to make changes to the setting.

Is there a way to work around this issue and get the IEDriverServer working? Or is Selenium just not an option for corporate environments that run IE 7+ on Windows 7 where the users are prevented from changing the Protected Mode settings?

Thanks, Dave

dsharp
  • 95
  • 8

3 Answers3

1

I had same problem.

I solved it by direct edit to registry.

Although the following is an example of Java, it can be similarly used in another language. I call this method before IEDriver instance creation.

If you want to disable it, please set the 3 instead of 0.

private void enableIEProtectModeOfAllZones() {

    final String[] ZONES = {
        "\"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\1\""
        , "\"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\2\""
        , "\"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3\""
        , "\"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\4\""
    };
    for (String zone : ZONES) {
        ProcessBuilder pb = new ProcessBuilder("cmd", "/c", "reg", "add",
                zone, "/v", "2500", "/t", "REG_DWORD", "/d", "0", "/f");
        try {
            pb.start();
        } catch (IOException ioe) { ioe.printStackTrace(); }
    }
}
Msyk
  • 662
  • 5
  • 14
0

As I understand you are using Selenium Webdriver. Please add the following: capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true) to your driver set up.

EdChum
  • 376,765
  • 198
  • 813
  • 562
Lucky
  • 11
  • 1
0

You need to create IE Driver instance with parameters, I'm assuming you are using C#

InternetExplorerOptions opts = new InternetExplorerOptions();
opts.IntroduceInstabilityByIgnoringProtectedModeSettings = true;

IWebDriver wDriver =  new InternetExplorerDriver(opts);

That will solve your issue

Tim
  • 2,695
  • 3
  • 33
  • 39