2

という名前のテスト スイートがあり、という名前FirstTestSuiteの testCase を作成しましたFirstTestCase。次のような石鹸 UI でグルーヴィーなスクリプトを作成しました。

def tc = testRunner.testCase.testSuite.project.testSuites["FirstTestSuite"].testCases["FirstTestCase"]

テスト ケースでは、いくつかのデータを含む Excel ファイルを作成する Web メソッドがあります。スクリプトを実行すると、呼び出していない Web メソッドが呼び出されます。私はこれに慣れていないので、スクリプトで何か見逃していましたか?

また、スクリプトを作成したら、crontab を使用してこのスクリプトを呼び出す方法はありますか?

ありがとう。

4

1 に答える 1

5

テスト ケースの実行を実行するコードを記述していません。このスクリプトを使用してみてください:

//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 テストを呼び出す方法もあります。

コマンドラインからの機能テストの実行は、soap ui に含まれる te​​strunner.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/bin/testrunner.sh : 実行中のスクリプトへのパス
-s"TestSuite 1" : テスト スイート名
-r : コンソールで要約レポートを作成
-a : レポート内のすべてのテスト結果のエクスポートエラー
-fyour_folder/reports : レポート フォルダーへのパス
your_folder/your_project-soapui-project.xml : SOAP UI プロジェクト ファイルへのパス

詳細はこちら: http://www.soapui.org/Test-Automation/functional-tests.html

crontab では、このシェル コマンドを開始するだけです。

于 2013-07-23T06:16:22.670 に答える