本地系统帐户的 IE 保护模式
我有一个在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这是解决方案(为了得到这个解决方案,我走遍了互联网的每个角落):
启动
RegEdit
并转到此键:在我的计算机 (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
并运行在弹出窗口中单击在“查看消息”上,然后在 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: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 ofpsexec
and runIn 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!
您可以尝试禁用 UAC,这也会禁用系统中所有用户的保护模式。
You could try disabling UAC, which will also disabled protected mode for all users in the system as well..
对解决方案最好的描述是这样的
https://stackoverflow.com/a/30242504/1371989
The best description of a solution is this
https://stackoverflow.com/a/30242504/1371989
IE WebDriver 上有一个设置告诉它忽略保护模式设置。从设置的名称来看,它可能会引入一些“不稳定”,但我对这种方法没有任何问题:
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: