空蚂蚁<;junitreport>;SoapUI testrunner XML结果的报告
我正在运行一个SoapUI项目,使用Ant获取JUnit报告 以下是我的build.xml:空蚂蚁<;junitreport>;SoapUI testrunner XML结果的报告,junit,ant,soapui,ant-junit,Junit,Ant,Soapui,Ant Junit,我正在运行一个SoapUI项目,使用Ant获取JUnit报告 以下是我的build.xml: <project basedir="." default="testreport" name="APIAutomation"> <target name="SoapUI"> <exec dir="." executable="C:\Program Files (x86)\SmartBear\SoapUI-5.0.0\bin\testrunner.bat">
<project basedir="." default="testreport" name="APIAutomation">
<target name="SoapUI">
<exec dir="." executable="C:\Program Files (x86)\SmartBear\SoapUI-5.0.0\bin\testrunner.bat">
<arg line="-r -j -a -f 'C:\Users\F3020722\Desktop\Notification\New folder' -sFirstLoginTest 'C:\Users\F3020722\Desktop\Notification\New folder\APIRegression.xml'"></arg>
</exec>
</target>
<target name="testreport" depends="SoapUI">
<junitreport todir="C:\Users\F3020722\Desktop\Notification\New folder\API">
<fileset dir="C:\Users\F3020722\Desktop\Notification\New folder\API">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames"
todir="C:\Users\F3020722\Desktop\Notification\New folder\reports\html">
</report>
</junitreport>
</target>
</project>
我得到了一个正确的XML报告。但是,JUnit报告是空的all
包含0和successrate
为Nan
有人能检查build.xml是否正确吗?- 看起来构建脚本似乎还可以
- 避免在目录名中使用空格
- 即使在windows上,也要像unix样式一样使用正向斜杠
- 在生成脚本中使用属性文件或属性,以便其他成员不会让它编辑生成脚本,因为路径可能会在机器之间更改
- 现在,在下面的脚本中添加了属性,您也可以将其外部化为属性文件
<project basedir="." default="testreport" name="APIAutomation">
<property name="test.suite" value="FirstLoginTest"/>
<property name="soapui.project" value="C:/Users/F3020722/Desktop/Notification/New folder/APIRegression.xml"/>
<property name="soapui.home" value="C:/Program Files (x86)/SmartBear/SoapUI-5.0.0"/>
<property name="results.dir" value="C:/Users/F3020722/Desktop/Notification/API/Results"/>
<property name="reports.dir" value="${results.dir}/Reports"/>
<property name="html.dir" value="${reports.dir}/html"/>
<target name="execute.project">
<exec dir="${soapui.home}/bin" executable="testrunner.bat">
<arg line="-raj -f ${results.dir} -s ${test.suite} ${soapui.project}" />
</exec>
</target>
<target name="testreport" depends="execute.project">
<mkdir dir="${reports.dir}"/>
<junitreport todir="${reports.dir}">
<fileset dir="${results.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${html.dir}" />
</junitreport>
</target>
</project>
@hub.docker.com
注意:除了机器路径之外,使用docker映像的构建脚本与上面完全相同。您是否看到C:\Users\F3020722\Desktop\Notification\New folder\API
目录下的TEST*.xml
文件?找到index.html
文件了吗?在C:\Users\F3020722\Desktop\Notification\New folder\API中可以看到TEST*.xml。。index.html位于C:\Users\F3020722\Desktop\Notification\New folder\reports\htmlHow可以在套件中测试用例?index.html是如何出现的?谢谢Rao。。我将尝试编辑的生成文件并更新您。出现以下错误。。但是testrunner.bat的路径是正确的。。构建文件:C:\Users\F3020722\Desktop\Notification\New folder\build.xml execute.project:构建失败C:\Users\F3020722\Desktop\Notification\New folder\build.xml:10:执行失败:java.io.IOException:无法运行程序“testrunner.bat”(在目录“C:\program Files(x86)\SmartBear\SoapUI-5.0.0\bin)中):CreateProcess error=2,系统找不到指定的文件,我希望您能按照我在回答中提到的指针操作。主要删除文件名和目录名中的空格。