我在 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 上禁用了保护模式。还是没有运气。
如何让我的代码恢复到正确的网络驱动状态?
您应该确保启用或禁用保护模式all4 个安全区域(Internet、本地 Intranet、受信任站点、受限制站点)。
换句话说,所有安全区域的设置值应该相同。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)