【问题标题】:Ant Junit & Selenium no information in reportsAnt Junit & Selenium 报告中没有信息
【发布时间】:2015-01-06 04:19:16
【问题描述】:

我正在使用 Ant 和 Selenium Webdriver 在 Eclipse 中运行 juit 测试。 测试按预期运行,我在控制台中看到结果并生成了 eb 报告,但结果不包括在内。 下面是我的 build.xml 文件。

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<property environment="env"/>
<property name="ECLIPSE_HOME" value="F:/Program Files (x86)/eclipse/"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.7"/>
<property name="source" value="1.7"/>
<property name="junit.output.dir" value="C:/Users/kev/workspace_hlgliveTest/hlglive/junit/"/>
<path id="hlglive.classpath">
    <pathelement location="bin"/>
    <pathelement location="C:/Selenium/selenium-server-standalone-2.44.0.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" name="build"/>
<target name="build-subprojects"/>
<target depends="init" name="build-project">
    <echo message="${ant.project.name}: ${ant.file}"/>
    <javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false" source="${source}" target="${target}">
        <src path="src"/>
        <classpath refid="hlglive.classpath"/>
    </javac>
</target>
<target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
<target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
    <copy todir="${ant.library.dir}">
        <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
    </copy>
    <unzip dest="${ant.library.dir}">
        <patternset includes="jdtCompilerAdapter.jar"/>
        <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
    </unzip>
</target>
<target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
    <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
    <antcall target="build"/>
</target>
<target name="classHlglive">
    <java classname="hlglive.classHlglive" failonerror="true" fork="yes">
        <classpath refid="hlglive.classpath"/>
    </java>
</target>
<target name="hmliveCH">
    <java classname="hlglive.hmliveCH" failonerror="true" fork="yes">
        <classpath refid="hlglive.classpath"/>
    </java>
</target>
<target name="junitreport">
    <junitreport todir="${junit.output.dir}">
        <fileset dir="${junit.output.dir}">
            <include name="*.xml"/>
        </fileset>
        <report format="frames" todir="${junit.output.dir}"/>
    </junitreport>
</target>    
</project>

这是控制台输出


Buildfile: C:\Users\kev\workspace_hlgliveTest\hlglive\build.xml
build-subprojects:
init:
build-project:
 [echo] hlglive: C:\Users\kev\workspace_hlgliveTest\hlglive\build.xml
build:
hmliveCH:
 [java] Starting ChromeDriver (v2.11.298604 (75ea2fdb5c87f133a8e1b8da16f6091fb7d5321e)) on port 24805
 [java] Only local connections are allowed.
 [java] Starting Chrome login Test
 [java] Current page title is: Haulage Manager Live
 [java] Testing combination of user name:  and password: 
 [java] Current page title is: Haulage Manager Live
 [java] Testing combination of user name: KEV and password: 
 [java] Current page title is: Haulage Manager Live
 [java] Testing combination of user name: KEV and password: bollo
 [java] Current page title is: Haulage Manager Live
 [java] Testing combination of user name: KEVIN and password: bollox
 [java] Current page title is: Haulage Manager Live
 [java] Testing combination of user name: KEV and password: bollox
 [java] Current page title is: Haulage Manager Live
 [java] Current page title is: Haulage Manager Live
 [java] Chrome Test complete
junitreport:
[junitreport] Processing C:\Users\kev\workspace_hlgliveTest\hlglive\junit\TESTS-TestSuites.xml to C:\Users\kev\AppData\Local\Temp\null978404570
[junitreport] Loading stylesheet jar:file:/F:/Program%20Files%20(x86)/eclipse/plugins/org.apache.ant_1.9.2.v201404171502/lib/ant-junit.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl
[junitreport] Transform time: 565ms
[junitreport] Deleting: C:\Users\kev\AppData\Local\Temp\null978404570
BUILD SUCCESSFUL
Total time: 18 seconds

所以看起来一切正常,但是当我查看生成的 html 页面时,我看到的只是这个。

谁能指出我哪里出错了。

谢谢

凯夫

【问题讨论】:

    标签: eclipse selenium ant junit webdriver


    【解决方案1】:

    结合使用 任务运行的测试结果。您曾经运行独立程序,而不是使用 运行测试套件。因此, 没有看到任何测试运行,并正确报告运行零测试。

    【讨论】:

      猜你喜欢
      • 2023-03-24
      • 1970-01-01
      • 2012-10-08
      • 1970-01-01
      • 1970-01-01
      • 2021-08-10
      • 1970-01-01
      • 2014-05-23
      • 1970-01-01
      相关资源
      最近更新 更多