0

我正在运行一个 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 新手,我正在使用 CentOS 7。我无法解决问题。

4

1 回答 1

0

我认为您必须安装 xvfb 插件,它使您能够在没有显示的情况下运行图形应用程序...查看 jenkins xvfb 文档以获取更多信息

于 2019-12-03T09:26:52.013 回答