2012-12-04 68 views
0

以下是我的代码,用于启动IE浏览器和http://google.co.in页面。无法在selenium webdriver中启动IE浏览器

File file = new File("C:/IEDriverServer/IEDriverServer.exe"); 
    System.setProperty("webdriver.ie.driver", file.getAbsolutePath()); 
    driver = new InternetExplorerDriver(); 
    baseUrl = "https://myruat.corp.webex.com/US/buy/signup.html"; 
    driver.manage().timeouts().implicitlyWait(120, TimeUnit.SECONDS); 

我正在此以下错误:
4235 [主要] INFO org.apache.http.impl.client.DefaultHttpClient - 处理请求时捕获I/O异常(org.apache.http.NoHttpResponseException) :目标服务器无法响应
4235 [主] INFO org.apache.http.impl.client.DefaultHttpClient - 重试要求

请让我知道如何纠正。

+0

我已经下载了IEDriver.exe并将其放在C:/IEDriverServer/IEDriverServer.exe中。我在Eclipse中添加了“selenium-server-standalone-2.25.0.jar”作为JAR。 – tester

+0

检查下面的链接。它应该能够帮助你。 http://code.google.com/p/selenium/issues/detail?id=3700 – Hemanth

回答

0

你在路径环境变量中设置了InternetExplorerDriver吗?

0

使用此...

// Simply give the path in the setProperty 

System.setProperty("webdriver.ie.driver", "absolute_path"); 

//(absolute_path = Full path to the exe file of Internet Explorer) 

// Ex : System.setProperty("webdriver.ie.driver", "C:\ \testing\ \IEDriver.exe"); 

// Use double slash instead of single slash. 


WebDriver driver = new InternetExplorerDriver(); 
0
System.setProperty("webdriver.ie.driver", "D:\\ImportantSeleniumTools\\IEDriverServer.exe"); 
    WebDriver driver=new InternetExplorerDriver(); 

在System.setProperty给,你必须保持InternetExplorer的服务器文件的位置。

相关问题