Structure XModules

XModules allow you to map tree-like test object structures.

Creating XModule References

XModules or XModuleAttributes can be used repeatedly in Tricentis Tosca by using references. If you make changes to Modules or referenced Modules, the system will adjust all references affected by these changes.

There are two ways to create references.

By dragging & dropping an XModule onto another XModule:

To use this functionality, please make sure that all parameters required for execution exist in the target module (see chapter "Default properties for Modules"). You can copy the properties from an equivalent XModuleAttribute and adapt them if necessary.

  1. Left-click onto the XModule you would like to use as a reference in an XModule structure definition and hold the left mouse button down.

  1. Drag this XModule onto the desired position and drop it there. Tricentis Tosca will create the XModule reference.

Creating an XModule Reference

By dragging & dropping an XModuleAttribute onto a Module folder:

  1. Left-click onto the XModuleAttribute to be converted into an XModule Reference and hold the left mouse button down.

  1. Drag the XModuleAttribute onto the desired Module folder and drop it there. Tosca will create a new XModule in the target Module folder and will convert the XModuleAttribute into an XModule reference.

Creating an XModule Reference

How to resolve Module References

  1. Right-click onto the reference to be resolved.

  1. Select the option Resolve Module Reference from the context menu.

The selected reference is now resolved but it is not deleted.

Resolving references

Generalizations and Specializations

Generalizations are XModules which you can use with various values. These values are referred to as "specializations". The ModuleAttributes of Generalization Modules are copied to each Specialization Module. If you make changes to ModuleAttributes of the generalization, all specializations will automatically be adapted. You can add further ModuleAttributes to a specialization without affecting generalization or or other specializations.

  1. Generalizations and specializations are defined in the Modules section (see also chapter "How to define generalizations").

  2. Specializations are selected in the TestCases section (see also chapter "Selecting specializations in the TestCase").

In Tosca you can use a Generalization Module or its specialization as references (see chapter "Creating XModule References").

How to define generalizations

  1. Create a new XModule by selecting Create XModule from the context menu of a Module folder. You can also left-click on the Module folder and select Create Object->XModule from the dynamic menu Modules. This Module should become the specialization of an already existing XModule.

  2. Select the XModule from which a specialization should be created.

  3. Hold the Shift key down and drag the XModule onto the newly created Module.

  4. Release the mouse button. A window will pop up.

  5. Select the option Set Generalization-Module.

    Tosca will create the specialization.

Set Generalization-Module

XModuleAttributes of a specialization are shown with the following icon: . The Generalization Module is displayed in the tooltip of the specialization.

Tooltip: Generalization-Module

XModule references are usually created from XModuleAttributes, and the reference is defined as generalization (see "By dragging & dropping an XModuleAttribute onto a Module folder:").

Property IsAbstract

Use the property IsAbstract (in the Properties tab) to classify XModules as abstract Modules . If you set the value of a specialization to True, you cannot use this in the TestCase.

Property IsAbstract

Clearing Generalization Modules

To reset specializations right-click on the required Specialization Module and select Clear Generalization-Module from the context menu. All ModuleAttributes which were transferred from the Generalization-Module and all referenced TestStepValues are deleted.

Clear Generalization-Module

Defining default specializations

In Tosca you can specify a default specialization for XModule references that were created from a Generalization Module (see chapter "By dragging & dropping an XModule onto another XModule:"). This default specialization is automatically selected whenever the Module is being used in the TestCase.

  1. Right-click onto an XModule reference and select Define default Specialization from the context menu.

Define default Specialization

  1. Select the required default Specialization Module from the subsequent dialog box:

Select Specialization Module

  1. When the respective TestStepValue is generated in the TestCase, it is automatically labeled as a specialization. The defined default specialization is shown in the tooltip.

Default specialization in the TestCase

Clearing default specializations

To reset the default specialization for the XModule reference of a Generalization Module, right-click onto the XModule reference and select the option Clear default Specialization from the context menu.

Selecting specializations in the TestCase

One XTestStepValue may have more than one specializations. These XTestStepValues look as follows in Tosca Commander: .

To select the required specialization:

  1. Right-click onto a TestStepValue which has several specializations and select Implement Specialization from the context menu.

Implement Specialization

  1. Select the required Specialization Module from the subsequent dialog box:

Select specialization

  1. All ModuleAttributes, which are additionally required for this specialization, are added and the icon of the TestStepValue changes as follows: .

Result: implemented specialization

Using XModuleAttributes repeatedly in the TestCase

Please proceed as follows to generate several XModuleAttributes in the TestCase:

  • Duplicate the TestStepValue several times within the TestStep.

  • Use the Cardinality property in the ModuleAttribute to specify repeated usage for a specific TestStepValue (see chapter "Default properties for Modules").

    Right-click on the TestStepValue and select Create XTestStepValue from the context menu to create further TestStepValues. You can also left-click on the TestStepValue and select Create Object->XTestStepValue (after this)from the dynamic menu TestCases.

The following values are available for selection:

Cardinality

Cardinality

Performance in the XTestStep

0-1

An XTestStepValue is initially created as a wildcard for each XModuleAttribute. Only one XTestStepValue may be created.

1

Exactly one XTestStepValue is created for an XModuleAttribute. The default ActionMode is the value set in the ActionMode column.

0-N

An XTestStepValue is initially created as a wildcard for each XModuleAttribute. Any number of XTestStepValues may be created.

1-N

An XTestStepValue is initially created as a wildcard for each XModuleAttribute. At least one XTestStepValue must be generated.

Property Cardinality