运行测试脚本的“无法打开与会话消息总线的连接”

时间:2019-12-03 06:50:08

标签: linux jenkins selenium-webdriver centos7 testng.xml

我正在运行一个Shell脚本来在Jenkins中执行测试用例。构建测试用例时,出现以下错误。

Failed to open connection to "session" message bus: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
1575281618795   mozrunner::runner   INFO    Running command: "/bin/firefox" "-marionette" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofile.NhG6sWTOQTlh"
Failed to open connection to "session" message bus: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
Running without a11y support!
Error: no DISPLAY environment variable specified
10:13:38.925 [main] ERROR com.ulab.selenium.base.BaseDriverProcessor - error initating driver..invalid argument: can't kill an exited process
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'localhost.localdomain', ip: '127.0.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.18.13-1.el7.elrepo.x86_64', java.version: '1.8.0_181'
Driver info: driver.version: FirefoxDriver

我正在Jenkins中使用自定义工作区,在我的情况下,它是“ / demo / JarFolder”
并使用Shell脚本(java -cp“ ./*:bin” org.testng.TestNG testng.xml)进行构建。

我是Linux的新手,正在使用CentOS7。我无法解决问题。

1 个答案:

答案 0 :(得分:0)

我认为您必须安装xvfb插件,该插件使您无需显示即可运行图形应用程序...请查看jenkins xvfb文档以获取更多信息