如果你想生成和SOAPUI documentation可以使用如下參數HTML報告:
-f - Specifies the root directory, where the runner will save test result files. If the specified directory does not exist, it will be created.
-F Specifies the format of the exported reports. Usage: -F. Supported formats include PDF, XLS, HTML, RTF, CSV, TXT and XML. If the parameter is not specified, PDF is used. To export results in several formats, separate them with commas. For example, -FPDF,XML,CSV.
注意:正如您在文檔中看到的,-F
參數僅適用於PRO版本。如果您使用免費版本,當您嘗試使用-F
參數,你會得到後續的輸出中: org.apache.commons.cli.UnrecognizedOptionException: Unrecognized option: -FPDF
所以,你可以修改task executeSOAPUI
添加-f location
和-FHTML
如下:
// execute SOAPUI
task executeSOAPUI(type: SoapUITask){
// simply pass the project path as argument,
// note that the extra " are needed
soapUIArgs = '-f "path/of/outputReports" -FHTML "/path/of/SOAPUI project xml/src/PCDEMO-soapui-project.xml"'
}
相反,如果您期待的Junit Html樣式報告您可以嘗試使用以下參數(該參數也僅適用於PRO版本):
-R - Specifies the type of the report data.
Usage: -R. Report type can be one of the following:
Project Report - Generates a report in the format that is specified by the -F argument. The runner will save the report files to the directory that the -f argument specifies. Depending on the -A argument value, the files can be organized into subdirectories.
TestSuite Report - As above, but for TestSuites.
TestCase Report - As above, but for TestCases.
JUnit-Style HTML Report - Generates a report as JUnit-style HTML files. See JUnit-Style HTML Reports. When this value is used, the runner ignores the -F and -A arguments.
Data Export - Generates XML files with report data. See Data Export. When you use this argument, -F must be XML or must not be specified.
Use the -f argument to specify the directory, where the runner will save generated report files.
使用這個你task
可能是:
// execute SOAPUI
task executeSOAPUI(type: SoapUITask){
// simply pass the project path as argument,
// note that the extra " are needed
soapUIArgs = '-f "path/of/outputReports" -R"JUnit-Style HTML Report" "/path/of/SOAPUI project xml/src/PCDEMO-soapui-project.xml"'
}
聲明:我沒有PRO版本,所以我無法測試任何我給的答案的選項。
您的代碼應該與您的問題放在一起,而不是作爲評論。請編輯您的問題並刪除評論。另請閱讀[如何問](http:// stackoverflow。COM /幫助/如何對問)。 – aribeiro
謝謝....我已經完成了。 – user2530711