Java 如果我在eclipse中通过ANT运行测试用例,JUnit HTML报告(index.HTML)不会在JUnit文件夹中生成

Java 如果我在eclipse中通过ANT运行测试用例,JUnit HTML报告(index.HTML)不会在JUnit文件夹中生成,java,eclipse,ant,selenium-webdriver,junit,Java,Eclipse,Ant,Selenium Webdriver,Junit,我正在eclipse中通过ANT运行JUnit测试用例,构建是成功的,但是测试用例的JUnitHTML报告(index.Html)没有在JUnit文件夹中生成 以下是版本: ANT:apache-ANT-1.9.4 JUnit:JUnit4.11JAR文件 Eclipse:版本:3.7.2 请帮忙 我假设您正在使用ant junit任务来运行测试用例。然而,要生成HTML报告,您需要添加junit报告任务。请看上面的例子 <target name="test-html"> <

我正在eclipse中通过ANT运行JUnit测试用例,构建是成功的,但是测试用例的JUnitHTML报告(index.Html)没有在JUnit文件夹中生成

以下是版本:

ANT:apache-ANT-1.9.4 JUnit:JUnit4.11JAR文件 Eclipse:版本:3.7.2


请帮忙

我假设您正在使用ant junit任务来运行测试用例。然而,要生成HTML报告,您需要添加junit报告任务。请看上面的例子

<target name="test-html">
  <junit fork="yes" printsummary="no" haltonfailure="no">
    <batchtest fork="yes" todir="${test.reports}" >
      <fileset dir="${classes}">
        <include name="**/*Test.class" />
      </fileset>
    </batchtest>
    <formatter type="xml" />
    <classpath refid="test.classpath" />
  </junit>

  <junitreport todir="${test.reports}">
    <fileset dir="${test.reports}">
      <include name="TEST-*.xml" />
    </fileset>
    <report todir="${test.reports}" />
  </junitreport>
</target>

请编辑您的问题并添加包含
的Ant脚本。