无法在selenium webdriver中启动IE浏览器

时间:2012-12-04 12:41:32

标签: selenium

以下是启动IE浏览器和http://google.co.in页面的代码。

    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 [main] INFO org.apache.http.impl.client.DefaultHttpClient - 处理请求时捕获的I / O异常(org.apache.http.NoHttpResponseException):目标服务器无法响应
4235 [main] INFO org.apache.http.impl.client.DefaultHttpClient - 重试请求

请告诉我如何纠正。

3 个答案:

答案 0 :(得分:0)

您是否在路径环境变量中设置了InternetExplorerDriver?

答案 1 :(得分: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();

答案 2 :(得分:0)

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

在System.setProperty中,给出保存InternetExplorer服务器文件的位置。

相关问题