错误:无法打开显示:Selenium测试:: 0 [英] Error: cannot open display: :0 for Selenium tests
本文介绍了错误:无法打开显示:Selenium测试:: 0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
首先我遇到以下错误:
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
Error: no display specified
因此,我已经使用export DISPLAY=:0
来解决此问题.接下来,我发现Selenium测试正在使用root用户运行,并且一切都很好.
So I have used export DISPLAY=:0
to circumvent this problem. Followed to that I have found Selenium tests were running using the root user and all was fine.
但是现在我可以看到何时从Jenkins执行这些测试,出现以下错误:
However now I can see when these tests are getting executed from Jenkins the following error is coming up:
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
No protocol specified
Error: cannot open display: :0
我正在Redhat 6盒子上运行它.
I am running this on a Redhat 6 box.
推荐答案
You can download the Jenkins xvnc plugin and make that plugin start(and export) a virtual display for selenium to use. The jenkins user may not have access to the :0 display.
这篇关于错误:无法打开显示:Selenium测试:: 0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文