2016-10-02 58 views
3

我已经经历过以前的问题,但没有发现任何人遇到我的问题。硒webdriver似乎无法正常使用Firefox 49.0。我错过了什么吗?

这个简单的代码挂起

from selenium import webdriver 
d = webdriver.Firefox(); 

浏览器被推出,但它只是挂在那儿。经过一段时间,它崩溃,我得到错误

selenium.common.exceptions.WebDriverException: Message: Can't load the profile. 
Profile Dir: /tmp/tmpn_MQnf If you specified a log_file in the 
FirefoxBinary constructor, check it for details. 

我在Ubuntu 14.04 LTS上有Firefox49。我有硒2.53.6和阅读以前的职位,我升级到硒3.0.0.b3。我也下载了geckdriver,并把它放在/ usr/bin中

看起来我还在运行旧版本的硒。但是,当我卸载并安装硒3.0.0.b3,我看到以下错误 -

selenium.‌​common.exceptions.We‌​bDriverException: 
Message: Service geckodriver unexpectedly exited. Status code was: 2 

我错过了什么?

+0

它看起来像我还在运行旧版本的硒。但是当我卸载并安装硒3.0.0.b3时,我看到以下错误------------------------------- -------------------------------------------------- ---------- selenium.common.exceptions.WebDriverException:消息:服务geckodriver意外退出。状态代码是:2 – Raju

+0

看着geckdriver.log它说这个 - >用法: geckodriver [选项] geckodriver:未知选项--port – Raju

回答

0

尝试将下载的Gecko驱动程序重命名为Wires并设置下面提到的功能。

System.setProperty("webdriver.gecko.driver", "//home//.....//BrowserDrivers//wires"); 
DesiredCapabilities capabilities = DesiredCapabilities.firefox(); 
capabilities.setCapability("marionette", true); 
Driver = new MarionetteDriver(capabilities); 

我与上面的代码试图在火狐49的Linux操作系统Ubuntu 14.04 LTS ...代码工作正常,我在Java中.. 也尝试从Beta硒的webdriver降级到2.53的Beta版是不稳定的..

相关问题