【问题标题】:jenkins cannot run firefox: No protocol specified Error: cannot open display: :0jenkins 无法运行 firefox:未指定协议错误:无法打开显示:0
【发布时间】:2015-06-08 11:02:25
【问题描述】:

我已经在 linux mint 上安装了 jenkins 作为服务。我正在尝试运行用 python 编写的测试,而脚本无法运行 firefox。这条线有问题。

... self.browser = webdriver.Firefox() ...

当我以 jenkins 用户身份登录时,我无法运行 firefox。收到此错误:

(进程:3758):GLib-CRITICAL **:g_slice_set_config:断言 'sys_page_size == 0' 失败 未指定协议 未指定协议 指定错误:无法打开显示:0

当我从我的(登录的)用户运行 Firefox 时,它可以工作。

【问题讨论】:

标签: linux firefox jenkins python-3.4


【解决方案1】:

只需在您的机器上安装一个虚拟帧缓冲区,它就可以工作。
现在我正在使用 Xvfb,但还有很多其他的。
以下是一些设置机器的教程:

还有这个插件:https://wiki.jenkins-ci.org/display/JENKINS/Xvfb+Plugin

【讨论】:

  • 我使用硒砂解决了这个问题。谢谢大家。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-01-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多