Ant junit run throws测试失败错误

时间:2013-10-29 18:59:19

标签: selenium ant junit

我正试图在eclipse中使用ant运行selenium junit测试。下面是我的build.xml文件,如果我在eclipse中将它作为junit测试运行,它运行正常。但是当我使用蚂蚁运行它时,它并不成功。构建是成功的,但测试失败了。如果我遗失任何东西,请告诉我。

<?xml version="1.0" encoding="UTF-8"?>
<project default="runjunit" name="firstbuild">
  <target name="runjunit" depends="compile">
    <junit printsummary="on">
      <test name="com.test.abc"/>
      <classpath>
        <pathelement location="C:\eclipse\plugins\org.junit_4.10.0.v4_10_0_v20120426-0900\junit.jar"/>
        <pathelement location="C:\sample\selenium-2.34.0\selenium-java-2.34.0.jar"/>
        <pathelement location="classes"/>
      </classpath>
    </junit>
  </target>
  <target name="compile">
    <javac includeantruntime="false" srcdir="./src" destdir="classes" classpath="C:\eclipse\plugins\org.junit_4.10.0.v4_10_0_v20120426-0900\junit.jar;C:\sample\selenium-2.34.0\selenium-java-2.34.0.jar"/>
  </target>
</project>


Buildfile: C:\New folder\workspace\build.xml
compile:
runjunit:
    [junit] Running com.test.abc
    [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
    [junit] Test com.test.abc FAILED
BUILD SUCCESSFUL
Total time: 409 milliseconds

0 个答案:

没有答案