詹金斯不能运行Firefox:没有协议指定错误:无法打开显示器::0 [英] jenkins cannot run firefox: No protocol specified Error: cannot open display: :0

查看:259
本文介绍了詹金斯不能运行Firefox:没有协议指定错误:无法打开显示器::0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

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

lockquote

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


我的(登录)用户。

解决方案

只需在您的机器上安装虚拟帧缓冲区, $ b现在我使用的是Xvfb,但还有很多其他的。

这里有一些教程来设置你的机器:



另外,这个插件: https://wiki.jenkins-ci.org/display/JENKINS/ Xvfb +插件


I have installed jenkins as a service on linux mint. I am trying to run tests written in python and script cannot run firefox. This line is a problem.

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

When i log in as jenkins user, i can't run firefox. getting this error :

(process:3758): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed No protocol specified No protocol specified Error: cannot open display: :0

Firefox works when i run it from my (logged in) user.

解决方案

Just install a virtual framebuffer in your machine and it will work.
Now i'm using Xvfb, but there are many others.
Here is some tutorials to setup your machine:

Also, there is this plugin: https://wiki.jenkins-ci.org/display/JENKINS/Xvfb+Plugin

这篇关于詹金斯不能运行Firefox:没有协议指定错误:无法打开显示器::0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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