我使用ChromeDriver和Selenium来运行我的自动化测试。测试套件在Eclipse和命令行中都能成功运行。但是,当我尝试在Jenkins中构建它时,它不会运行。
这是我在詹金斯的工作配置(所有信息的名称都是为保密而清理的): 在此输入图像描述 我可以确认它的Ant运行的是JDK8。
这是构建的控制台输出:
[junit] Running main.TESTNAME
[junit] Starting ChromeDriver 2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f) on port 27352
[junit] Only local connections are allowed.
[junit] Apr 26, 2018 3:52:34 PM org.openqa.selenium.remote.ProtocolHandshake createSession
[junit] INFO: Detected dialect: OSS
[junit] Running through test suite as:
[junit] User: USERNAME
我的build.xml下面主要是自动生成的,除了我添加JUnit集成的结尾:
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="build" name="PROJECTSeleniumTest">
<property environment="env"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.8"/>
<property name="source" value="1.8"/>
<path id="PROJECTSeleniumTest.classpath">
<pathelement location="bin"/>
<pathelement location="lib/byte-buddy-1.7.5.jar"/>
<pathelement location="lib/client-combined-3.8.1-sources.jar"/>
<pathelement location="lib/client-combined-3.8.1.jar"/>
<pathelement location="lib/commons-codec-1.10.jar"/>
<pathelement location="lib/commons-exec-1.3.jar"/>
<pathelement location="lib/commons-logging-1.2.jar"/>
<pathelement location="lib/gson-2.8.2.jar"/>
<pathelement location="lib/guava-23.0.jar"/>
<pathelement location="lib/hamcrest-core-1.3.jar"/>
<pathelement location="lib/httpclient-4.5.3.jar"/>
<pathelement location="lib/httpcore-4.4.6.jar"/>
<pathelement location="lib/junit-4.12.jar"/>
</path>
<target name="init">
<mkdir dir="bin"/>
<copy includeemptydirs="false" todir="bin">
<fileset dir="src">
<exclude name="**/*.launch"/>
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="bin"/>
</target>
<target depends="clean" name="cleanall"/>
<target depends="build-subprojects,build-project,junit" name="build"/>
有谁知道原因可能是什么?谢谢。
慕桂英3389331
互换的青春