Firefox的版本不与硒工作 [英] Firefox Build does not work with Selenium

查看:275
本文介绍了Firefox的版本不与硒工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的研究,我没有在Firefox某些源$ C ​​$ C修改和建立它自己。为了自动化测试,我选择了使用Selenium但不幸的是,我新建的Firefox似乎不支持硒。

for my research, I did some source code modifications in firefox and build it myself. In order to automate testing, I opted to use Selenium but unfortunately, my newly built Firefox seem to not support Selenium.

我做了以下内容:

from selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary

binary = FirefoxBinary("/path/to/firefox/binary")

d = webdriver.Firefox(firefox_binary=binary)

d.get("http://www.google.de")

在Firefox没有打开,响应(我可以输入在搜索栏中网站)。但是,一段时间后,Python脚本与以下错误消息崩溃:

The Firefox does open and is responsive (I can enter a website in the search bar). But after a while, the python script crashes with the following error message:

Traceback (most recent call last):
  File "firefox.py", line 7, in <module>
    d = webdriver.Firefox(firefox_binary=binary)
  File "/usr/local/lib/python3.4/dist-packages/selenium/webdriver/firefox/webdriver.py", line 59, in __init__
    self.binary, timeout),
  File "/usr/local/lib/python3.4/dist-packages/selenium/webdriver/firefox/extension_connection.py", line 47, in __init__
    self.binary.launch_browser(self.profile)
  File "/usr/local/lib/python3.4/dist-packages/selenium/webdriver/firefox/firefox_binary.py", line 66, in launch_browser
    self._wait_until_connectable()
  File "/usr/local/lib/python3.4/dist-packages/selenium/webdriver/firefox/firefox_binary.py", line 109, in _wait_until_connectable
    raise WebDriverException("Can't load the profile. Profile "
selenium.common.exceptions.WebDriverException: Message: Can't load the profile. Profile Dir: %s If you specified a log_file in the FirefoxBinary constructor, check it for details.

我做了谷歌的错误消息,并且大多数解决方案的建议,我应该更新硒,因为它不支持使用Firefox的版本。不幸的是,我安装了硒(2.44.0)的最新版本,我甚至用Firefox(版本33)的旧版本,以排除这一点。

I did google that error message and most solutions suggested, that I should Update Selenium since it does not support the Firefox version used. Unfortunately, I installed the newest version of selenium (2.44.0) and I even used an older version of firefox (version 33) to rule out that point.

我也确信,我的code的修改是不是这个通过建立一个干净,未修改火狐崩溃的原因。硒不能与这个Firefox工作,要么。

I also made sure that my code modifications are not the reason for this to crash by building a clean, unmodified firefox. Selenium doesn't work with this firefox either.

如果我不指定Firefox的二进制和硒,让使用安装了Firefox,一切工作正常。所以我的猜测是,什么是错的Firefox的建设,我做到了完全一样的在线文档中提到的(例如./mach版本)。

If I don't specify a firefox binary and let Selenium use the installed Firefox, everything works fine. So my guess is, that something is wrong with the firefox build, which I did exactly as mentioned in the online documentation (e.g. ./mach build).

有没有人一个想法,什么我的错误可能是什么?任何帮助是极大AP preciated!

Has anyone an idea, what my mistake might be? Any help is greatly appreciated!

一些设置信息:


  • 火狐33

  • 硒2.44.0

  • 的Python 3.4(也试过2.7,不工作)

  • 火狐建立与Ubuntu 14.04

推荐答案

的Ubuntu 14.04,火狐36.0,硒2.44.0。
同样的问题,通过解决:

Ubuntu 14.04, firefox 36.0, selenium 2.44.0. The same problem, was solved by:

sudo pip install -U selenium

硒2.45.0是FF36确定。

Selenium 2.45.0 is OK with FF36.

更新:硒2.53+与FF45兼容

update: Selenium 2.53+ is compatible with FF45

您可以获取较旧版本的FF 这里

You can get older FF versions here

这篇关于Firefox的版本不与硒工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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