求助ie的RemoteWebDriver方式失败
WebDriver wd = new RemoteWebDriver(new URL("http://localhost:5555/wd/hub"), ieDesiredcap);报错信息:
Exception in thread "main" org.openqa.selenium.WebDriverException: The path to the driver executable must be set by the webdriver.ie.driver system property; for more information, see http://code.google.com/p/selenium/wiki/InternetExplorerDriver. The latest version can be downloaded from http://selenium-release.storage.googleapis.com/index.html
用本地方式好用:WebDriver wd = new InternetExplorerDriver(ieDesiredcap);
用火狐的远程方式好用:WebDriver wd = new RemoteWebDriver(new URL("http://localhost:5555/wd/hub"), ffDesiredcap);
谁知道是怎么回事啊?
代码
System.setProperty("webdriver.ie.driver","D:\\working\\Selenium\\down\\IEDriverServer_Win32_2.44.0\\IEDriverServer.exe");
//System.setProperty("webdriver.ie.driver","IEDriverServer.exe");
DesiredCapabilities ffDesiredcap = DesiredCapabilities.firefox();
DesiredCapabilities chromeDesiredcap = DesiredCapabilities.chrome();
DesiredCapabilities ieDesiredcap = DesiredCapabilities.internetExplorer();
ieDesiredcap.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,true);
//WebDriver wd = new InternetExplorerDriver(ieDesiredcap);
WebDriver wd = new RemoteWebDriver(new URL("http://localhost:5555/wd/hub"), ieDesiredcap);
//WebDriver wd = new RemoteWebDriver(new URL("http://localhost:5555/wd/hub"), ffDesiredcap);
wd.get("http://www.baidu.com");
Thread.sleep(1200);
System.out.println(wd.getCurrentUrl());
wd.quit();
已经解决。
iedriver要放到selenium-server-standalone-x.xx.x.jar的同级目录 :lol
页:
[1]