IE Protected Mode for Local System Account

前端 未结 4 1954
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-05 19:54

I have a Windows Service that runs a Team City Build agent on a Windows 7 OS.

This agent triggers NUnit tests which use the Selenium IE web drivers to execute a seri

相关标签:
4条回答
  • 2021-01-05 20:15

    You could try disabling UAC, which will also disabled protected mode for all users in the system as well..

    0 讨论(0)
  • 2021-01-05 20:21

    Here is the solution (and I've been to every corner of the Internet in order to get this):

    Fire up RegEdit and go to this key:

    HKEY_USERS\S-1-5-18\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones
    

    On my machine (Windows 7) the Local System account is S-1-5-18. This might be the same for all versions of Windows, but I don't know about that.

    In that registry key, there are five more keys 1, 2, 3, 4 and 5 - each representing a Zone.

    For every zone, if there is a DWORD value with the name "2500", set its value to 0 to turn protected mode off. Note that you don't have to add it if it isn't there.

    The value "2500" is supposed to control the tick box "Enable protected mode".

    UPDATE (from an anon user):

    A graphical way of doing the same is to ensure the "Interactive Services Detection" service (UI0Detect) is running (note that Windows 8/2012 and later need the HKLM\SYSTEM\CurrentControlSet\Control\Windows\NoInteractiveServices registry key to be set correctly in order for the popup to appear) get hold of psexec and run

    psexec -si 0 "C:\Program Files\Internet Explorer\iexplore.exe"
    

    In the popup click on View the message, then after the screen switches in Internet Explorer go to Tools -> Internet options | Security and check the Security level for each zone.

    Happy UI testing!

    0 讨论(0)
  • 2021-01-05 20:25

    The best description of a solution is this https://stackoverflow.com/a/30242504/1371989

    0 讨论(0)
  • 2021-01-05 20:34

    There is a setting on the IE WebDriver that tells it to ignore the protected mode settings. Judging by the name of the setting it might introduce some "instability", but I've had no problems with this approach:

    var options = new InternetExplorerOptions();
    // avoid the "Protected Mode must be set to the same value (enabled or disabled) for all zones" error
    options.IntroduceInstabilityByIgnoringProtectedModeSettings = true;
    return new InternetExplorerDriver(options);
    
    0 讨论(0)
提交回复
热议问题