51Testing软件测试论坛

标题: 求助ie的RemoteWebDriver方式失败 [打印本页]

作者: wsryyffs    时间: 2015-4-9 06:32
标题: 求助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();  


作者: wsryyffs    时间: 2015-4-9 11:30
已经解决。
iedriver要放到selenium-server-standalone-x.xx.x.jar的同级目录
作者: 黑羽祭    时间: 2015-4-9 12:46





欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2