Reusable TestStepBlocks

Reusable TestStepBlocks contain TestSteps that can be reused in multiple TestCases, so you don't have to redo your work. You can create and manage Resusable TestStepBlocks by using TestStepLibraries (see chapter "Use TestStepLibraries").

Properties

Description

You can input any text for this property. The information entered is also displayed as a tooltip.

The information that is stored here does not have any effect on automated steering.

Use Business Parameters

Business parameters display a summary of the relevant business-based information from a Reusable TestStepBlock. Dynamic values are displayed and managed separately from the TestStepValues. Business parameter values are defined in the appropriate reference.

Business parameter: Example

XL paths are not translated upon instantiation of TestCase templates in Reusable TestStepBlocks which contain business parameters.

How to create Business Parameters

  1. Right-click on a Reusable TestStepBlock and select Create Business Parameter Container from the context menu. All business parameters are defined in this newly created business parameter container.

  2. Right-click onto the business parameter container and select Create Parameter from the context menu.

  1. Assign a name to the new business parameter.

  2. Drag the newly created business parameter onto the chosen TestStepValue and drop it there. A link is created.

    You can also create a link to the business parameter by entering the syntax {PL[<Business Parameter Name>]} into the required TestStepValue.

    If you drag & drop a business parameter onto a TestStep instead of a TestStepValue, a condition for the TestStep execution dependent on the business parameter is defined in the Condition column of the TestStep.

The following options are also available from the business parameter context menu for manual creation of business parameters:

  • Create Parameter (after this): creates a business parameter directly beneath the selected business parameter.

  • Create Duplicate (after this): creates a duplicate of the selected business parameter.

  • Create Parameter: creates a business parameter beneath the selected business parameter.

Create business parameters via drag and drop

  1. Right-click on a Reusable TestStepBlock and select Create Business Parameter Container from the context menu. All business parameters are defined in this newly created business parameter container.

  2. Drag the chosen TestStepValues onto the container named Business Parameter.

    Please note that only TestStepValues which have already been generated can be dragged and dropped onto the Business Parameter container.

 Creating Business Parameters

The TestStep which belongs to the business parameters is also linked with the Reusable TestStepBlock when you drag and drop. The link is shown as a parameter link in the Value column of the TestStepValues linked to a business parameter:

Syntax:

{PL[<Business Parameter Name>]}

The business parameter name must not contain any dots . as this is interpreted as a delimiter between individual parameters.

Create a Reusable TestStepBlock with defined business parameters

To create a Reusable TestStepBlock with defined business parameters, follow these steps:

  1. Mark one or multiple TestSteps, TestStep folders or TestStepValues within a TestCase.

  2. Right-click on the selected elements and select Create Reuseable TestStepBlock Parameters from the context menu. You can only create Reusable TestStepBlock parameters if the selected elements are located within the same TestCase.

Please note that you must check out the TestStepLibrary in the parent TestCase folder of the element you want to convert to a business parameter. If no TestStepLibrary exists, the parent TestCase folder itself has to be checked out.

For further information, please refer to chapter "Checkin and checkout objects".

If a TestStepLibrary exists in the parent TestCase folder of the selected elements, Tosca creates a Reusable TestStepBlock within this TestStepLibrary. If the parent TestCase folder does not contain a TestStepLibrary, Tosca creates one.

Tosca replaces the selected element with a reference to the newly created Reusable TestStepBlock.

The business parameter values are defined in the corresponding business parameter reference.

Define a value range for business parameters

In the ValueRange column, you can define a value range for every business parameter for later use. Individual values are separated by semi-colons.

Business parameters - ValueRange

Modify business parameters

If business parameter names are changed, or if a business parameter is moved within a business parameter container, the corresponding parameter links are automatically adapted.

Use business parameters in TestCases

If a Reusable TestStepBlock is for instance used (referenced) in a TestCase, business parameter references are created in the TestCase that point to the business parameters of the TestStepBlock. TestCase-specific data is defined in the business parameter references.

  1. Define the business parameter values in the corresponding business parameter reference.

Business parameters with defined values - details view

  1. Select the Reusable TestStepBlock reference. By clicking on the button in the TestCases ribbon menu, the syntax in the TestStepValue is resolved (dispersed text view). If the condition of a TestStep is not fulfilled, this TestStep will be hidden in the dispersed text view. Alternatively, the key combination Shift + F11 can be used.

Business parameters are resolved - dispersed view

All objects within a Reusable TestStepBlock reference (apart from business parameters) can be hidden from view by using the button in the TestCases ribbon menu. This view is called Simple View and can also be enabled via the F11 key.

TestStepValues are hidden - Simple View

Delete business parameter values

The values of all the business parameter references in a business parameter container are deleted in a Reusable TestStepBlock reference by using the option Delete parameter tree from the context menu of the business parameter container. Individual business parameter reference values are deleted by selecting Delete from the context menu of the required business parameter.

The business parameter itself is removed from a Reusable TestStepBlock by using the Delete option. The deleted business parameter is thus no longer available in other references. If a reference is defined for the deleted parameter, the message <no associated parameter> is shown instead of the business parameter reference.

Nested Reusable TestStepBlocks

If a Reusable TestStepBlock is referenced in another Reusable TestStepBlock, the following should be noted:

  • Reusable TestStepBlocks are independent objects and can only transfer external data by using their business parameter reference.

  • Therefore, the referenced Reusable TestStepBlock can only have a parameter link to the business parameters of the parent TestStepBlock in its business parameter references, but not in its TestStepValues.

For the example shown in the illustration below, this means:

  • The business parameter references P3 and P4 have parameter links to the business parameters P1 and P2 from the parent Reusable TestStepBlock as values.

  • Only the values for the business parameters P1 and P2 can be adapted if Block1 is used at a later point of time.

  • Parameter links are used on the business parameters P3 and P4 in the linked TestStepValues of Block2_Reference.

Nested Reusable TestStepBlocks