我在 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 个安全区域(Internet、本地 Intranet、可信站点、受限站点)启用或禁用保护模式。
换句话说,所有安全区域的设置值应该相同。
关于.net - Internet Explorer 保护模式错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11121773/