Tag: xvfb

在jenkins构建下以无头模式运行cucumber-jvm selenium测试用例时出错

背景 我有一个在spring-boot和maven中设计的项目。 它包含了yellow-jvm selenium测试用例,我希望在jenkins构建中以无头模式运行。 为此,我在jenkins构建机器上安装了XVfb ,并确保Xvfb正在运行。 $ps -ef | grep Xvfb root 3804 1 0 Sep29 ? 00:52:41 Xvfb -ac :99 -screen 0 1280x1024x16 接下来,我还在构建开始时导出DISPLAY变量,如下所示, export DISPLAY=:99 错误 测试无法执行以下stackstrace 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 Error: no display specified at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:118) […]