Use test case templates as base models for your test cases. For example, you can create a template with data variations to be reused on different tests. You can create test case templates for Test Automation projects, including other file types such as Global Exception Handler. For other projects (e.g., Process), you can create workflow templates.
条件
- テンプレートは、プロジェクトの種類、およびテンプレートの作成に使用する言語に固有です。
- テンプレートをワークフローに変換したり、コンパイルしたり、パブリッシュしたりすることはできません。
- You can make use of reusable content by creating a library with test case templates. Test data variation is not exported to the library alongside the test case template.
The resources referenced in the template will not be copied locally to the project where you are trying to import the library. The template should not contain references to other assets, such as workflows within the library.
テンプレートのソース
新しいファイルを追加するときには、ファイルのベースとなるテンプレートを選択できます。選択できるテンプレートは、追加するファイルの種類 (ワークフローまたはテスト ケース) や、プロジェクトの [テンプレート] フォルダーにテンプレートをあらかじめ追加してあるかどうかによって異なります。
組み込みテンプレート
空のテスト ケース
Choose Empty Test Case when you create a test case if you want to add a Placeholder activity that you want to invoke at a later stage.
ビヘイビア駆動開発 (BDD) テスト ケース
BDD stands for Behavioural-Driven Development. Choose BDD Test Case when you create a test case to structure your test around Given-When-Then containers.
ローカル ファイル テンプレート
The local templates are created in the Templates folder of the project when you extract a file as template and when you add a template to the Templates folder. Local file templates are available only inside the project where you create, or extract them.
You can create local templates of three types: execution template, workflow template, and test case template. When you extract a file as a template, the template type is applied automatically based on the type of file you extract (workflow or test case). When you manually add a template to the Templates folder, you select the type of template to create.
パッケージ ファイル テンプレート
タイムアウト付きのテスト
The Test With Timeout template is available only with the Testing activity package, version 22.10 or higher. Choose Test With Timeout when you create a test case if you want to use a timeout or to take screenshots when a verification fails.
このテンプレートは、時間ベースの例外をスローし、ワークフローで発生したエラーのスクリーンショットを作成するように設定されています。
注
takeScreenshotOnException
Boolean 変数をfalse
に設定した場合は、必ず [タイムアウト スコープ] アクティビティの [タイムアウト メッセージ] プロパティを変更してください。- タイムアウトは
duration
変数で変更できます。既定値は 5 分に設定されています。- テスト プロジェクトの設定を構成することで、スクリーンショットをマシン上に保持できます。
ローカル ファイル テンプレートを追加する
You can use the contextual menu in the Project panel to manually add execution, and test case templates based on other templates to your project. After you add a template, you can edit it in the Designer, and then use it as a starting point for creating other files.

- To add a test case template, right-click the Templates folder, and then select Add > Test Case Template. Follow the test case creation process to configure the template.

- 実行テンプレートを追加するには、[テンプレート] フォルダーを右クリックして [追加] > [実行テンプレート] を選択します。

ファイルをテンプレートとして抽出する
- Studio でワークフローを開きます。
- [プロジェクト] パネルで、テスト ケースを右クリックし、[テンプレートとして抽出]を選択します。

テスト ケースが [プロジェクト] > [テンプレート] に保存されます。テスト ケースは、コピー アンド ペーストすることも、移動してテスト フォルダーに戻すこともできます。

注
- テスト ケースやワークフローのテンプレートは、[テンプレート] フォルダーから直接作成できます。
- [テンプレート] フォルダー内でコンテキスト メニューを使用すると、ファイルの比較などのさまざまな操作を実行できます。
ライブラリ内のテスト ケース テンプレート
You can create test case templates in libraries the same way you create them in processes. After you publish the library, the templates marked as public are available as package file templates in projects where the library is installed.
テンプレートからテスト ケースを作成する
- テスト プロジェクトを作成します。
- テンプレートとして使用するテスト ケースを構築します。
- テスト ケースの構築が完了したら、そのテスト ケースを右クリックして [テンプレートとして抽出] を選択します。
テンプレートに名前を付け、テンプレートを保存する場所として [テンプレート] フォルダーを選択して、[作成] を選択します。この例では、テンプレートの名前は「MyFirstTestCaseTemplate」です。

- [デザイン] タブに移動し、ファイル グループの [新規] > [テスト ケース] を選択します。[新しいテスト ケース] ウィンドウが表示されます。

- 適切な名前を付け、前の手順で作成したテンプレートを [テンプレート] ドロップダウン リストから選択します。この例では「MyFirstTestCaseTemplate」を選択します。
テンプレートを削除する
テンプレートを削除するには、[プロジェクト] パネル内の [テンプレート] フォルダーを展開し、テンプレートを右クリックして [削除] を選択します。
関連記事
3 か月前に更新