[英]Unable to open IE11 driver instance using Selenium WebDriver with Java
System.setProperty("webdriver.ie.driver","C:\\Users\\IEDriverServer_Win32_2.45.0\\IEDriverServer.exe");
WebDriver driver = new InternetExplorerDriver();
driver.get("http://xxx");
Shows error while executing above code:执行上述代码时显示错误:
Exception in thread "main" org.openqa.selenium.remote.SessionNotFoundException: Unexpected error launching Internet Explorer.
线程“main”org.openqa.selenium.remote.SessionNotFoundException 中的异常:启动 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.
必须为所有区域将启用保护模式设置为相同的值(启用或禁用)。 (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 1.33 seconds
(警告:服务器没有提供任何堆栈跟踪信息)命令持续时间或超时:1.33 秒
Can anyone suggest to resolve this issue?任何人都可以建议解决这个问题吗?
You cannot open IE browser instance if Protected Mode settings are not the same for all zones OR if the browser is zoomed.如果所有区域的保护模式设置不同,或者浏览器被缩放,则无法打开 IE 浏览器实例。
Below workaround is provided which will help you to temporarily solve the problem.提供了以下解决方法,可帮助您暂时解决问题。
DesiredCapabilities caps = DesiredCapabilities.internetExplorer();
caps.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,true);
WebDriver driver = new InternetExplorerDriver(caps);
Note : If you don't have permission to change IE settings,Request you to contact your IT administrator to get the required changes done.注意:如果您无权更改 IE 设置,请联系您的 IT 管理员以完成所需的更改。
If u are behind proxy with no access provision to change the protected mode settings then use this capabilities如果您在代理后面没有访问权限来更改保护模式设置,则使用此功能
DesiredCapabilities cap = DesiredCapabilities.internetExplorer();
cap.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
this will introduce some flakiness这将引入一些片状
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.