Use TestStepLibraries
TestStepLibraries allow you to centrally manage TestSteps, XTestSteps, and sequences of TestSteps that you want to reuse in multiple TestCases. You can only have one TestStepLibrary per TestCase folder.
TestStepLibraries are made up of Reuseable TestStepBlocks which can be used to create TestCases.
If Reusable TestStepBlocks are used to create TestCases, the corresponding references to them are created in the TestCases:
Icon | Description |
---|---|
TestStepLibrary | |
Reusable TestStepBlock | |
Reusable TestStepBlock Reference | |
Business Parameter Container | |
Business Parameter |
To learn about best practices for TestStepLibraries and ReusableTestStepBlocks, check out Best practices | TestCases | Repetitions and reuse.
Create TestStepLibraries
Right-click on the folder where you want to create a TestStepLibrary. If the folder you select already contains a TestStepLibrary you will not be able to create another one, as any given folder can only contain one TestStepLibrary.
- Select Create TestStepLibrary from the context mini toolbar. You can also left-click on the folder and select Create Folder->TestStepLibrary from the dynamic menu TestCases.
- Tosca Commander™ will create a new TestStepLibrary within the selected folder. You can either assign a new name to the new TestStepLibrary or you can use the default name Libraryby pressing Enter.
Create Reusable TestStepBlocks
To use a TestStepLibrary, you need to create Reusable TestStepBlocks that are made up of TestSteps.
To create a Reusable TestStepBlock, right-click onto a TestStepLibrary and select Create Reusable TestStepBlock from the mini toolbar.
Alternatively, click on the TestStepLibrary and select Create Folder in the dynamic menu TestCases.
You can also create Reusable TestStepBlocks from TestSteps:
- Click on a TestStep.
- Drag and drop the selected TestStep onto a TestStepLibrary.Tosca will create a Reusable TestStepBlock within the TestStepLibrary for this particular TestStep. The TestStep itself is converted into a reference and given the name extension _Reference.
Reusable TestStepBlocks and their references can be renamed just like folders. You can also add, edit or remove TestSteps within Reusable TestStepBlocks.
Each modification within the TestStepLibrary affects all references. |
Work with Reusable TestStepBlocks
You can add existing Reusable TestStepBlocks to TestCases by using drag and drop. This creates a reference to the Reusable TestStepBlock in the TestCase.
You can show or hide TestSteps within a Reusable TestStepBlock by clicking the Show TestStep Details toggle button in the dynamic menu TestCases. When you activate this button to show TestStep details, the background of the toggle button is highlighted in blue.
When Show TestStep Details is activated, the Show Business Param Values toggle becomes available. You can use this toggle to easily resolve business parameter values from {PL{…]} to the value given in the business parameters. When you activate Show Business Param Values, the background of the toggle button is highlighted in blue.
By default, TestStep details and business parameter values are hidden.
Library toggles activated.
Merge Reusable TestStepBlocks
You can merge Reusable TestStepBlocks using drag and drop, provided that:
- Name, Value, ActionMode and DataType of the TestStepValues are identical.
- The same Modules are used. For this purpose, Modules can be merged in advance (Exchanging Modules).
- Paths and conditions of TestStep folders are identical (optional).
- Business Parameters of Reusable TestStepBlocks are identical (optional).
- The order of the TestSteps is identical.
Only individual Reusable TestStepBlocks can be merged. |
Procedure
- Left click on the Reusable TestStepBlock to be merged and keep the mouse button pressed.
- Drag the selected Reusable TestStepBlock onto the TestStepBlock you want to merge it with.
- Release the left mouse button.
- Select the option Merge ReusableTestStepBlocks in the window that appears.
In the next dialog window, the user can decide whether the Reusable TestStepBlock that is no longer being used should be removed.
Merge TestStepLibraries
You can merge TestStepLibraries using drag and drop, provided that the included Reusable TestStepBlocks are identical (Merge Reusable TestStepBlocks).
Procedure
- Left click on the TestStepLibrary to be merged and keep the left mouse button pressed.
- Drag the selected TestStepLibrary onto the TestStepLibrary you want to merge it with.
- Release the left mouse button. The following dialog window pops up: Delete ReusableTestStepBlocks which are not used any more?.
- Select Yes or No, depending on whether you would like to delete the Reusable TestStepBlocks that are no longer being used.