由于我们的大多数客户仍然使用ie8和ie9,我们切换到Windows 8操作系统,它带有ie10,并且由于客户的要求,我们需要在ie8版本上测试软件。我有一个问题,即将ie版本切换为8,即使ie10(令人惊讶地)提供了ie8模式。
System.setProperty(SeleniumProperties.ieDriver, SeleniumProperties.ieLocation);
DesiredCapabilities ieCapabilities = null;
ieCapabilities = DesiredCapabilities.internetExplorer();
ieCapabilities.setVersion("8");
driver = new InternetExplorerDriver(ieCapabilities);
System.out.println(((RemoteWebDriver) driver).getCapabilities());
驱动程序功能保持不变:
Capabilities [{platform = WINDOWS,elementScrollBehavior = 0,javascriptEnabled = true,enablePersistentHover = true,ignoreZoomSetting = false,browserName = internet explorer,enableElementCacheCleanup = true,unexpectedAlertBehaviour = dismiss,version = 10,cssSelectorsEnabled = true,ignoreProtectedModeSettings = false ,requireWindowFocus = false,initialBrowserUrl =,handlesAlerts = true,nativeEvents = true,browserAttachTimeout = 0,takesScreenshot = true}]
任何类型的工作都将非常感谢!
答案 0 :(得分:2)
您无法使用InternetExplorerDriver设置浏览器仿真模式。它根本不受支持。使用安装了IE 8的虚拟机。