.net - Internet Explorer 保护模式错误

标签 .net selenium nunit webdriver

我在 Visual Studio 中的代码使用 selenium webdriver 2.24.0。我使用的测试框架是 Nunit。在 2.24.0 版本发布之前,我的代码运行良好(加载差异浏览器、驱动网站)。

我将新的 IE 独立服务器添加到我的项目中。

现在,每当我运行代码时,NUnit 都会遇到此错误消息。

 FirstSeleniumTest.SeleniumTest.TestGoogle:
SetUp : System.InvalidOperationException : Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones. (NoSuchDriver)
TearDown : System.NullReferenceException : Object reference not set to an instance of an object.

然后弹出命令提示符。
Started InternetExplorerDriver server (64-bit)
2.24.0.0
Listening on port 50329

我在 IE 上禁用了保护模式。仍然没有运气。

如何让我的代码恢复到正确的网络驱动?

最佳答案

您应该确保为所有 4 个安全区域(Int​​ernet、本地 Intranet、可信站点、受限站点)启用或禁用保护模式。
换句话说,所有安全区域的设置值应该相同。

关于.net - Internet Explorer 保护模式错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11121773/

相关文章:

c# - 具有复制/粘贴功能的只读 DataGridView?

javascript - Angular JS http 请求到 .NET 服务器

c# - 在设计器中查看表单时出现错误 - 我该如何避免这种情况?

Java - 如何使用 JavaScriptExecutor 调用字符串内的变量?

c# - NUnit 中不支持的测试框架错误

c# - 带有 ASP.NET 网站的 NUnit

asp.net - 某些浏览器上的 AjaxPro 中的 ConnectFailure

testing - 如何将 Sikuli 脚本导入 Selenium?

java - 如何使用java获取下个月的前三个日期

javascript - 如何使用 nUnit 对 JavaScript 进行单元测试?