在我的计算机上是Windows 8(Internet Explorer 10)
如何使用浏览器模式IE8运行带有Selenium的Internet Explorer
这是我的Selenium代码:
public static void main(String[] args) {
System.setProperty("webdriver.ie.driver","D://workspace//IEDriverServer_x64.exe");
DesiredCapabilities caps = DesiredCapabilities.internetExplorer();
caps.setCapability(
InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS
,true);
capab.setBrowserName("internet explorer");
// i was try this
// capab.setCapability(CapabilityType.VERSION, "9");
capab.setCapability("version", "9");
WebDriver driver = new InternetExplorerDriver(caps);
driver.get(" my url ");
}
答案 0 :(得分:0)
据我所知(有限),我们只能对我们系统中安装的浏览器运行selenium测试。我不认为capab.setCapability("version", "9")
实际启动了IE9,因为IE9实际上并不存在于你的机器中。
因此您必须安装旧版本的浏览器。 另一种解决方案是使用GRID在具有所需浏览器的另一台计算机上远程运行测试。