Skip to main content

Element: Test Action

Symbol: tm_icontestaction.png

Function: The element contains the configuration of the test driver actions. Test actions are the actual functional contents of a test script.

When you select a test action in the test script, the editor opens with the Test Action and Extended Settings tabs.

Each test action consists of exactly one action of a test driver and its configuration. Each test action of a test driver has its own specific configuration options. You can also configure the call and evaluation of a test action on the Extended Settings tab. The symbol in the test script changes accordingly.

Settings displayed in the test script editor

Visualization in the test script

Extended settings

_tm_icon_action.png

No extended settings enabled

_tm_icon_test_action_exclamation.png

Always execute enabled

Symbol grayed out

Ignore event enabled

(Condition "x>0")

An expression is defined in Condition.

(max 10 retries)

Max. retries set to 10

(Expected Exceptions)

At least one exception is entered in Expected Exceptions.

Tab: Test Action

Title

Name of the test action

Also displayed in the test script editor

Action

Selected action

The test driver is displayed in parentheses.

Example: AddDevice(TestManager.Devices)

If the input field is empty, then the actions of all test drivers are displayed in the list below. You can filter the display by typing in a corresponding string.

The test action is configured on the Configuration tab.

Input and output parameters of the test action are configured on the Parameters (<number of input parameters>/<number of output parameters>) tab.

Tip

The detailed description of the Configuration and Parameters tabs are located in the help for the test driver action in Reference, User Interface → Test Actions.

Tab: Advanced Settings

Table 11. Execution

Execute even on previous failure

standard icon: Even if test case actions have already occurred as failed during the test run, the action is still executed. If it is a conditional test action, then the next step is to evaluate the condition.

In the test script, the action is indicated by an exclamation mark after the symbol: _tm_icon_test_action_exclamation.png

_cds_icon_option_deactivated.png: If a test case action has occurred as failed during the test run, then the action is skipped. In a conditional test action, the evaluation of the condition is also skipped.

Condition

Expression

Evaluated at runtime

The test action is executed only if the expression is true. If the expression is false, then test action is skipped.

Example: iVar = 1

In the test script editor, a conditional test action is identified by displaying the condition in parentheses after the test action.

Example: (condition iVar = 1)

Note: If you use a test script variable in the expression, then you need to specify the variable with a placeholder operator.

Example: {TempPath} = 'D:\Temp'



Table 12. Delay&Retries

Initial delay [ms]

Time span (in milliseconds) after which the test action starts

Max. retries

Maximum number of repetitions until the action is evaluated with Succeeded

Maximum value: 100

An action is repeated until it is evaluated as Succeeded or the number of Max. retries is reached. The test action evaluated as Failed only then.

A delay time can be specified in Retry after [ms].

Retry after [ms]

Delay time (in milliseconds) until the next retry starts



Table 13. Result handling

Ignore mismatch

standard icon: The test case is processed independently of the result of the test action.

Cancel test run on failure

standard icon: If the test action fails, then the test run is aborted.

Result variable

Test script variable which contains the result of the test of the test action

This is also the declaration.

Example: TestAction_Result

. Possible results
  • Failed

  • Succeeded

  • Skipped

Example: TestAction_OK = (TestAction_Result = 'Succeeded')

Exception variable

Test script variable

This is also the declaration.

If an exception occurs during the test, then its name is stored in the variable. The variable is available for additional referencing (for example, in a Python script).



Table 14. Expected exceptions

Expected exceptions are those that have to occur during test execution. The test action is evaluated with Succeeded only then.

Exception type

Example: System.Exception

_cds_icon_arrow_down.png: Opens a list box with the possible types

  • Exception

  • TestFailedException

  • TestExecutionException

  • InvalidOperationException

Match type

Example: Exact

_cds_icon_arrow_down.png: Opens a list box with the possible types

  • Subclass

    The exception corresponds to a subclass of the required exception type.

  • Exact

    The exception corresponds to the required exception type.

Exception message

Text

While the test is running, the test is compared to the exception in order to check whether or not it is the expected exception. The check type you selected in Match Message is taken into account.

Note: Variable substitution is supported by {<variable>}. If messages contain braces, then variable substitution has to be suppressed. In this case, specify double braces: {{<text>}}}

Match Message

Example: Exact

_cds_icon_arrow_down.png: Opens a list box with the possible check types

. Check types:
  • Ignore:

    The message text is not checked.

  • Exact:

    The message text exactly corresponds to the predefined text in Exception Message.

  • Substring:

    The message text contains the predefined text in Exception Message.

  • Regex:

    The message text is compared with the regular expression from Exception Message.

Add

Adds another exception to the end of the table

Remove

Deletes the selected exception

Clone

Duplicates the selected exception and adds it to the end of the table

Inner

Adds a subordinate exception to the selected exception