我必须使用ant脚本通过Soap UI生成报告
SoapUi安装目录:C:SmartBear SoapUi -5.2.1soapui项目目录:C:UsersstDocuments logtestcase -soapui-project.xml
输出目录(要生成日志的目录):C:UsersstDesktoplogs
当我从soapUI testsuite窗格运行它时,它工作正常。在输出目录最终输出正在生成。我从soapui中复制了以下命令:cmd.exe /C testrunner.bat -sTestSuite -r -a -j -J -fC:UsersstDesktoplogs C:UsersstDocumentsLoginTestCase-soapui-project.xml
。
在ant脚本上使用相同的命令,它不工作,它只显示
main:
[exec] Microsoft Windows [Version 6.1.7601]
[exec] Copyright (c) 2009 Microsoft Corporation. All rights reserved.
[exec] C:SmartBearSoapUI-5.2.1bin>
BUILD SUCCESSFUL
Total time: 749 milliseconds
但是在输出文件夹中没有生成get。这是我在eclipse中使用的Ant脚本:
<?xml version="1.0"?>
<project default="main" basedir="C://SmartBear//SoapUI-5.2.1//bin">
<target name="main">
<exec executable="cmd">
<arg value="cmd.exe //C testrunner.bat -s TestSuite -r -a -j -J -f C://Users//st//Desktop//logs C://Users//st//Documents//LoginTestCase-soapui-project.xml" />
</exec>
</target>
</project>
与此同时,我还尝试了:
<?xml version="1.0"?>
<project default="main" basedir=".">
<target name="main">
<exec executable="cmd">
<arg value="cmd.exe //C 'C://SmartBear//SoapUI-5.2.1//bin//testrunner.bat' -s TestSuite -r -a -j -J -f C://Users//st//Desktop//logs C://Users//st//Documents//LoginTestCase-soapui-project.xml" />
</exec>
</target>
</project>
你应该删除额外的/
(你也可以删除cmd.exe
,因为它是多余的executable
属性):
<exec executable="cmd">
<arg value="/C testrunner.bat -s TestSuite -r -a -j -J -f C:/Users/st/Desktop/logs C:/Users/st/Documents/LoginTestCase-soapui-project.xml"/>
</exec>