Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Selenium挂起实例化FirefoxDriver_Java_Selenium_Webdriver - Fatal编程技术网

Java Selenium挂起实例化FirefoxDriver

Java Selenium挂起实例化FirefoxDriver,java,selenium,webdriver,Java,Selenium,Webdriver,我尝试开始使用selenium(今天下载了当前版本),并复制了他们打开浏览器并执行google搜索的示例 但是,程序永远挂在第1行WebDriver=newfirefoxdriver() 我已经安装了Firefox13 Thread dump: Thread [main] Thread.sleep(long) line: not available [native method] [local variables unavailable] FirefoxBinary.sleep(long

我尝试开始使用selenium(今天下载了当前版本),并复制了他们打开浏览器并执行google搜索的示例

但是,程序永远挂在第1行
WebDriver=newfirefoxdriver()

我已经安装了Firefox13

Thread dump: Thread [main] Thread.sleep(long) line: not available [native method] [local variables unavailable] FirefoxBinary.sleep(long) line: 218 FirefoxBinary.clean(FirefoxProfile, File) line: 234 NewProfileExtensionConnection.start() line: 76 FirefoxDriver.startClient() line: 200 FirefoxDriver(RemoteWebDriver).(CommandExecutor, Capabilities) line: 94 FirefoxDriver.(FirefoxBinary, FirefoxProfile) line: 147 FirefoxDriver.() line: 85 Test.main(String[]) line: 24 线程转储: 线程[主] Thread.sleep(长)行:不可用[本机方法][局部变量不可用] FirefoxBinary.睡眠(长)线:218 FirefoxBinary.clean(FirefoxProfile,文件)行:234 NewProfileExtensionConnection.start()行:76 FirefoxDriver.startClient()行:200 FirefoxDriver(RemoteWebDriver)。(命令执行器,功能)行:94 FirefoxDriver.(FirefoxBinary,FirefoxProfile)行:147 火狐司机。()电话号码:85 测试。主(字符串[])行:24
这些情况通常是Firefox和Selenium在兼容性方面有点“不同步”


您应该尝试两件事:将Selenium更新为最新版本和/或降级Firefox。密切关注

通常新浏览器的热点-我在别处寻找问题。Webdriver或selenium服务器

Selenium 2.23中添加了Firefox 13支持。请看

我一直在使用Firefox 18,但我刚刚自动更新到19,这似乎破坏了webdriver。Mozilla与以前版本的链接并不突出:


在没有设置显示的情况下,尝试在无头CentOS服务器上实例化webdriver时,看到了这种行为


Per--您可以使用Xvfb,它提供了一个不需要连接到物理显示器的X服务器

对,Selenium还没有发布对Firefox 13的支持。Selenium 2.23包括Firefox 13支持。我的答案是在Firefox 13进入发布阶段之前,我已经编辑到现在。现在还有一个pageLoadTimeout。+1谢谢。那是为了我。通过包管理器更新了Selenium。猛敲修正。虽然这可以从理论上回答问题,但在此处包含答案的基本部分,并提供链接供参考。