【发布时间】:2016-10-05 06:33:48
【问题描述】:
我尝试在 java 中运行 selenium 脚本。但每次我尝试创建 firefox 驱动程序时,我都会收到此错误
[WebDriverException: Failed to connect to binary FirefoxBinary(/usr/bin/firefox) on port 7055; process output follows:
(process:32000): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
(firefox:32000): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.
Error: no display specified
关于我的问题的一些背景信息。
- 我尝试在 aws ec2 上使用 ubuntu 14.0.4 运行 selenium
- 我已经尝试安装 xvfb,以便 Firefox 可以在无头模式下运行并使用一些引用运行 xvfb(https://medium.com/@griggheo/running-selenium-webdriver-tests-using-firefox-headless-mode-on-ubuntu-d32500bb6af2#.u0hrlct41、https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c)
- 我可以毫无问题地运行 selenium python 脚本
- 我在我的 java selenium 脚本中使用了这个 selenium sbt "org.seleniumhq.selenium" % "selenium-java" % "2.53.1",
谁能帮助我使用 java 运行无头硒?
【问题讨论】:
标签: java selenium amazon-web-services firefox