【发布时间】:2015-06-11 11:21:55
【问题描述】:
我正在使用 Selenium 2.45 和 Firefox 35.0.1 无头浏览器。在开发和测试环境中一切都很好,但在生产中,我遇到了错误。
Driver info: driver.version: FirefoxDriver
org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(/usr/bin/firefox) on port 7055; process output follows:
Xlib: extension "RANDR" missing on display ":1".
process 20275: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open "/var/lib/dbus/machine-id": No such file or directory
See the manual page for dbus-uuidgen to correct this issue.
D-Bus not built with -rdynamic so unable to print a backtrace
Xlib: extension "RANDR" missing on display ":1".
process 20300: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open "/var/lib/dbus/machine-id": No such file or directory
See the manual page for dbus-uuidgen to correct this issue.
D-Bus not built with -rdynamic so unable to print a backtrace
Build info: version: '2.45.0', revision: '5017cb8e7ca8e37638dc3091b2440b90a1d8686f', time: '2015-02-27 09:10:26'
System info: host: 'prod', ip: '127.0.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.32-431.1.2.0.1.el6.x86_64', java.version: '1.7.0_65'
生产环境:
1) 已下载 firefox-35.0.1
[prod@prod ~]$ ls /usr/local/
bin etc firefox firefox-35.0.1.tar.bz2 games include lib lib64 libexec sbin share src
2) 软链接到 /usr/bin/firefox
[prod@prod ~]$ ll /usr/bin/firefox
lrwxrwxrwx 1 root root 26 Jun 11 15:59 /usr/bin/firefox -> /usr/local/firefox/firefox
[prod@prod ~]$
3) 冉Xvfb
[prod@prod ~]$ ps ax |grep Xvfb
15425 ? S 0:00 sudo Xvfb +extension RANDR :1 -screen 0 1024x768x24
15426 ? S 0:00 Xvfb +extension RANDR :1 -screen 0 1024x768x24
23102 pts/6 S+ 0:00 grep Xvfb
测试环境:
[root@vc-stage ~]# ll /usr/bin/firefox
lrwxrwxrwx 1 root root 26 May 24 21:32 /usr/bin/firefox -> /usr/local/firefox/firefox
[root@stage ~]#
[root@stage ~]# ls /usr/local/
bin etc firefox firefox-35.0.1.tar.bz2 games include lib lib64 libexec sbin share src
[root@stage ~]#
[root@stage ~]# ps ax | grep Xvfb
3899 pts/5 S+ 0:00 grep Xvfb
27393 ? S 0:01 Xvfb +extension RANDR :1 -screen 0 1024x768x24
[root@stage ~]#
test 和 prod 之间的唯一区别是;在测试中,我从 root 用户运行所有内容。在 prod 中,我由 sudo 用户运行。
更新:错误消息消失了,没有任何更改,Duh。现在,它根本不创建 Firefox 驱动程序。
【问题讨论】:
标签: linux selenium centos6 xvfb