UnreachableBrowserException尝试使用IEDriver在Selenium Webdriver中启动 [英] UnreachableBrowserException trying to launch in Selenium Webdriver using IEDriver

查看:109
本文介绍了UnreachableBrowserException尝试使用IEDriver在Selenium Webdriver中启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一组在Firefox和Chrome中非常有效的自动化,我也想推出一个IEDriver实例。

I have a set of automations that work fantastically in Firefox and Chrome, and I'd like to launch an instance of IEDriver as well.

我按照 Selenium的谷歌代码维基,具有正确的路径(如果我改变路径,我得到一个不同的例外,所以它绝对是正确的)。但由于某些原因,它仍然无法启动,只是超时。

I've set up IEDriver as per Selenium's Google Code wiki, with the correct path (if I change the path I get a different exception, so it's definitely correct). But for some reason it still can't launch, and just times out.

启动它的代码(最后一行抛出异常):

The code to launch it (the last line throws the exception):

        File ieDriver = new File("C:/Users/whatever/path/IEDriverServer.exe");
        System.setProperty("webdriver.ie.driver", ieDriver.getAbsolutePath());
        WebDriver ie = new InternetExplorerDriver();

例外情况是:

Exception in thread "main" org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '2.33.0', revision: '4ecaf82108b2a6cc6f006aae81961236eba93358', time: '2013-05-22 12:00:17'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_21'
Driver info: driver.version: InternetExplorerDriver
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:216)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:201)
    at org.openqa.selenium.ie.InternetExplorerDriver.run(InternetExplorerDriver.java:184)
    at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:174)
    at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:143)
    at uk.co.know.kiteTest.WebDriverManager.<init>(WebDriverManager.java:52)
    at uk.co.know.kiteTest.RunAutomations.main(RunAutomations.java:13)
Caused by: org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
Build info: version: '2.33.0', revision: '4ecaf82108b2a6cc6f006aae81961236eba93358', time: '2013-05-22 12:00:17'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_21'
Driver info: driver.version: InternetExplorerDriver
    at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:165)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:62)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:527)
    ... 7 more
Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http://localhost:38622/status] to be available after 20014 ms
    at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:104)
    at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:163)
    ... 9 more
Caused by: com.google.common.util.concurrent.UncheckedTimeoutException: java.util.concurrent.TimeoutException
    at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:143)
    at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:79)
    ... 10 more


推荐答案

我遇到了同样的错误然后发现了这个问题。在我的情况下,事实证明我的系统上有64位版本的IEDriver.exe,但我使用的是32位Windows平台。所以这个错误表明操作系统无法执行驱动程序。我试图直接在命令提示符下运行驱动程序,以确定32位操作系统没有将64位驱动程序exe识别为可执行程序。

I was hitting this same error and then found this question. In my case, it turned out that I had the 64 bit version of the IEDriver.exe on my system, but I was on a 32 bit windows platform. So this error was indicating that the OS failed to execute the driver program. I tried to run the driver directly in a command prompt to see that infact the 32 bit OS was not recognizing the 64 bit driver exe as an executable program.

获取正确的32位IEDriver.exe解决了我的问题。

Getting the correct 32 bit IEDriver.exe solved my problem.

这篇关于UnreachableBrowserException尝试使用IEDriver在Selenium Webdriver中启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆