TA的每日心情 | 开心 2015-5-5 13:21 |
---|
签到天数: 1 天 连续签到: 1 天 [LV.1]测试小兵
|
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();
|
|