本地系统帐户的 IE 保护模式

发布于 2024-12-02 00:34:10 字数 276 浏览 0 评论 0原文

我有一个在 Windows 7 操作系统上运行 Team City Build 代理的 Windows 服务。

该代理触发 NUnit 测试,该测试使用 Selenium IE Web 驱动程序来执行一系列测试。

为了使 Selenium IE Web 驱动程序正常工作,所有区域的保护模式需要设置为相同的值(保护模式打开或关闭)。

问题是本地系统帐户的默认设置无效(某些区域在保护模式下运行,其他区域则不是)。

谁能告诉我如何更改所有用户或本地系统帐户用户的保护模式设置?

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 series of tests.

For the Selenium IE web drivers to work the protected mode for all zones needs to be set to the same value (either protected mode on or off).

The problem is the default settings for the Local System Account are invalid (some zones are running in protected mode, others are not).

Can anyone can tell me how to change the protected mode settings for either all users or the Local System Account user?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

り繁华旳梦境 2024-12-09 00:34:10

这是解决方案(为了得到这个解决方案,我走遍了互联网的每个角落):

启动 RegEdit 并转到此键:

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

在我的计算机 (Windows 7) 上,本地系统帐户是S-1-5-18。对于所有版本的 Windows 来说这可能都是相同的,但我不知道这一点。

在该注册表项中,还有五个键 1、2、3、4 和 5,每个键代表一个区域。

对于每个区域,如果存在名称为“2500”的 DWORD 值,请将其值设置为 0 以关闭保护模式。请注意,如果不存在,则不必添加它。

值“2500”应该控制复选框“启用保护模式”。

更新(来自匿名用户):

执行相同操作的图形化方法是确保“交互式服务检测”服务 (UI0Detect) 正在运行(请注意,Windows 8/2012 及更高版本需要 HKLM\SYSTEM\CurrentControlSet\Control\Windows\NoInteractiveServices 注册表项要正确设置才能出现弹出窗口)获取 psexec 并运行

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

在弹出窗口中单击在“查看消息”上,然后在 Internet Explorer 中切换屏幕后,转到“工具”->“互联网选项 |安全并检查每个区域的安全级别。

快乐的 UI 测试!

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!

意中人 2024-12-09 00:34:10

您可以尝试禁用 UAC,这也会禁用系统中所有用户的保护模式。

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

魂归处 2024-12-09 00:34:10

对解决方案最好的描述是这样的
https://stackoverflow.com/a/30242504/1371989

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

白云不回头 2024-12-09 00:34:10

IE WebDriver 上有一个设置告诉它忽略保护模式设置。从设置的名称来看,它可能会引入一些“不稳定”,但我对这种方法没有任何问题:

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);

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);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文