您還沒有編寫運行測試用例執行的代碼。嘗試使用此腳本:
//get test case from other project or from the same one
project = testRunner.getTestCase().getTestSuite().getProject().getWorkspace().getProjectByName(project_name)
testSuite = project.getTestSuiteByName(suite_name);
testCase = testSuite.getTestCaseByName(testcase_name);
//set properties if you need
testRunner.testCase.setPropertyValue(property_name, property_value);
testRunner.testCase.setPropertyValue(another_property_name, another_property_value);
// run test case
runner = testCase.run(new com.eviware.soapui.support.types.StringToObjectMap(), false);
此外還有一種方法可以使用crontab調用soap ui測試。
從命令行運行功能測試是使用包括在皁UI testrunner.bat/.SH腳本,這需要若干參數來控制哪些測試運行,輸出,例如直接的:
sh SmartBear/soapUI-4.5.1/bin/testrunner.sh -s"TestSuite 1" -r -a -fyour_folder/reports your_folder/your_project-soapui-project.xml
其中
SmartBear/soapUI的-4.5.1 /斌/ testrunner.sh:路徑行書
-s 「的TestSuite 1」:測試套件名稱
-r:創建控制檯
-a總結報告:報告中輸出所有測試結果,不僅僅是錯誤
-fyour_folder /報告:路徑報表文件夾
您的文件夾/ your_project-的soapUI-project.xml中:路徑你的肥皂UI項目文件
點擊此處瞭解詳情:http://www.soapui.org/Test-Automation/functional-tests.html
而且在crontab中你只是需要啓動這個shell命令。
感謝您的幫助。 – Valla
對於您提到的groovy腳本。我可以使用crontab運行groovy腳本嗎?要清楚我是否寫上述腳本並將其保存爲.groovy,然後可以使用crontab運行它? – Valla
不完全。我的意思是你可以使用crontab運行testrunner.sh。 Testrunner使用groovy腳本運行測試套件。 – ITemius