我在远程节点上遇到IE11问题。当我运行测试时,它只打开页面并在此之后停止运行,我已经做了以下
但是没有解决问题
任何建议?
P.S
功能[{platform = WINDOWS,javascriptEnabled = true, elementScrollBehavior = 0,ignoreZoomSetting = true, enablePersistentHover = false,ie.ensureCleanSession = true, browserName = internet explorer,enableElementCacheCleanup = true, unexpectedAlertBehaviour = accept,version = 11, ie.usePerProcessProxy = false,ignoreProtectedModeSettings = true, cssSelectorsEnabled = true,requireWindowFocus = true,initialBrowserUrl =, handlesAlerts = true,ie.forceCreateProcessApi = false,nativeEvents = true, browserAttachTimeout = 0,ie.browserCommandLineSwitches =, takesScreenshot =真}]
代码
String Node = "http://xx.xx.xx.xxx:5558/wd/hub";
DesiredCapabilities cap = DesiredCapabilities.internetExplorer();
cap.setCapability("ie.ensureCleanSession", true);
cap.setBrowserName("iexplore");
cap.setPlatform(org.openqa.selenium.Platform.WINDOWS);
cap.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,true);
cap.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION,true);
cap.setCapability(InternetExplorerDriver.ENABLE_ELEMENT_CACHE_CLEANUP,true);
cap.setCapability(InternetExplorerDriver.IGNORE_ZOOM_SETTING,true);
cap.setCapability(InternetExplorerDriver.UNEXPECTED_ALERT_BEHAVIOR,"accept");
cap.setCapability(InternetExplorerDriver.REQUIRE_WINDOW_FOCUS,true);
cap.setCapability(InternetExplorerDriver.INITIAL_BROWSER_URL,"");
cap.setCapability(InternetExplorerDriver.SILENT,true);
driver = new RemoteWebDriver(new URL(Node), cap);
答案 0 :(得分:0)
您是否安装了Windows更新KB3025390?
如果是这样,这将解释为什么IEDriver无法正常工作。
如果您卸载该更新它将正常工作,这似乎是Selenium人员都知道的问题。我不确定这个问题的进展。
答案 1 :(得分:0)
我只需要在初始驱动程序INITIAL_BROWSER_URL,""
中添加一些链接,例如www.google.com INITIAL_BROWSER_URL,"https://www.google.com"
。我不知道为什么,但这是让它工作的唯一方法。< / p>