詹金斯的硒化验:

时间:2019-07-16 06:35:15

标签: jenkins xvfb selenide

我有用硒化钠写的测试。 在localhost Jenkins上-它们运行成功,但是如果我要将它们放在我的公司Jenkins上-问题开始了

我第一次尝试,没有Xvfb: 日志:

Failed scenarios:
src/test/resources/features/Login.feature:6 # Scenario: Login to programs with invalid credentials
src/test/resources/features/Login.feature:10 # Scenario: Login to programs with valid credentials

2 Scenarios (2 failed)
6 Steps (2 failed, 4 skipped)
0m3.089s

java.lang.IllegalStateException: No webdriver is bound to current thread: 1. You need to call open(url) first.

我不知道为什么,在本地詹金斯上没有错误,例如您需要先调用open(url)。

第二次尝试,我读到需要xvfb

jenkins中xvfb的

配置: https://i.imgur.com/zFkcPFZ.png https://i.imgur.com/BHCwDBS.png

日志:

Xvfb starting$ Xvfb :3 -screen 0 1024x758x16 -fbdir /var/lib/jenkins/xvfb-8-..fbdir5500835804021266071
ERROR: Failed to parse POMs
java.io.IOException: Cannot run program "Xvfb": error=2, No such file or directory
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
	at hudson.Proc$LocalProc.<init>(Proc.java:249)
	at hudson.Proc$LocalProc.<init>(Proc.java:218)
	at hudson.Launcher$LocalLauncher.launch(Launcher.java:929)
	at hudson.Launcher$ProcStarter.start(Launcher.java:449)
	at org.jenkinsci.plugins.xvfb.Xvfb.launchXvfb(Xvfb.java:587)
	at org.jenkinsci.plugins.xvfb.Xvfb.setUp(Xvfb.java:697)
	at jenkins.tasks.SimpleBuildWrapper.setUp(SimpleBuildWrapper.java:146)
	at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:667)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
	at hudson.model.Run.execute(Run.java:1794)
	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:429)
Caused by: java.io.IOException: error=2, No such file or directory
	at java.lang.UNIXProcess.forkAndExec(Native Method)
	at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
	at java.lang.ProcessImpl.start(ProcessImpl.java:134)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
	... 13 more
Finished: FAILURE

如果我取消选中xvfb安装“自动安装”,并且如果我尝试将“在其中找到Xvfb可执行文件的目录”设置为默认的/ usr / bin,我也会看到错误 主目录路径不包含Xfvb可执行文件:/ usr / bin

詹金斯(Jenkins)是否遇到过类似的问题? 我该怎么办? 我不能使用自动安装,应该与Jenkins管理员讨论xvfb可执行文件的路径吗?

0 个答案:

没有答案