尝试使用Selenium Web驱动程序脚本启动IE11时出现错误消息,这是在WINDOWS SERVER 2012 R2从属计算机上尝试使用JENKIN JOB运行脚本时出现的,但是此脚本在我的本地计算机上运行良好(Win 7和IE11)。
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{data=null, stacktrace=, error=session not created, message=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., platform=ANY}]
我知道这是一个非常基本的问题,但我无法解决。我在下面尝试过
我的代码是:
System.setProperty("webdriver.ie.driver",IEDriver);
DesiredCapabilities capab = DesiredCapabilities.internetExplorer();
capab.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION,true);
capab.setCapability(InternetExplorerDriver.UNEXPECTED_ALERT_BEHAVIOR,true);
capab.setCapability(InternetExplorerDriver.REQUIRE_WINDOW_FOCUS, true);
GlobalVar.wDriver = new InternetExplorerDriver(capab);
GlobalVar.wDriver.manage().window().maximize();
GlobalVar.wDriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);