Through execution templates, you can wrap test cases at runtime to use your defined execution conditions for multiple scenarios. For example, instead of copying, pasting, and maintaining multiple test cases, you can create a single template that acts as a boilerplate to wrap the test cases at runtime.
- When you run or debug the file, the test case and its associated execution template are merged into a temporary file. The collection of arguments and variables from both files are compared by name at runtime. If the execution template shares a matching argument or variable name with the test case, it will be linked in the Invoked Workflow File after the merge. If the test case does not have any matching arguments with the execution template, the arguments from the former file will be copied to the latter.
- Moving or renaming an execution template automatically updates its associated test cases.
- When publishing a project with execution templates, any publishable test cases are merged with the execution templates. The resulting files are the project entry points.
- You can make use of reusable content by creating a library with execution templates.
- You can invoke multiple placeholders in the workflow.
The execution template acts as a wrapper for test cases. In the Designer panel, you can see a placeholder activity within the execution template.
This activity is going to be replaced at runtime with an Invoke activity, adding the invoked test case to the execution template.
To run a test case inside an execution template at runtime, follow these procedures:
Create an execution template before setting it to a test cases.
- Open your workflow in Studio.
- In the Project panel, right-click the Templates folder to open the dropdown menu.
- Navigate to Add > Execution Template.
- Enter a name for your execution template and choose the location where it is going to be stored.
A new tab opens in the Designer panel with your execution template. You can build the template to match your testing needs.
- Click Save when your execution template is done.
To run or debug a test case with an execution template, you need to add it to an execution template (Set Execution Template). Alternatively, you can set an execution template for a newly created test case.
- Open or create your test case in Studio. If you do not have one yet, you can create a test case.
- In the Projects panel, right-click a test case to open the dropdown menu.
- Click Set Execution Template and select a template from the dropdown list.
- Click Ok to confirm. The execution template is added to the test case. Running or debugging this test case will proceed according to your associated execution template.
Now you can run or debug the test case as it will be executed with the execution template.
The placeholder activity needs to be included in the execution template. It will not work if it is in a different workflow that is invoked by the execution template.
- Add test data to your test case
- Publish test case to Orchestrator
- Set application testing Workflow Analyzer rule (see Incorrect Amount of Placeholders in Execution Template)
- Open your workflow in Studio.
- In the Project panel, right-click a test case to open the dropdown menu.
Hover the mouse over a test case to show whether it is added to an execution template.
- Click Set Execution Template and select <no execution template> from the dropdown list.
- Click Ok to confirm.
Updated 2 months ago