Skip to main content

Action: InstallMessageHandler

Function: The action replies automatically together with the action UninstallAndCheckMessageHandler and checks message windows which would block during an automatic test script run.

Call: System test driver

The two actions InstallMessageHandler and UninstallAndCheckMessageHandler always have to be used together. The actions InstallMessageHandler and UninstallAndCheckMessageHandler mark the beginning and end of the sequence within which the configured handling of the message windows is to be applied. A nested definition of multiple message handlers is permitted.

Tab: Configuration

Identifier

Key used for identifying the corresponding message handler in the final UninstallAndCheckMessageHandler

Example: Message_Handler_App1

Expected messages

Table for filtering and configuring message handling

Each line contains the configuration of a message.

Type

. Message type
  • <all>: All message types

  • Information: Simple message window with only an OK button

  • Warning: Simple message window with only an OK button

  • Error: Simple message window with only an OK button

  • Prompt: Simple prompts with standardized response options for the user. CODESYS currently provides the following types: OK, OK/Cancel, Yes/No, Yes/No/Cancel, Retry/Cancel, and Cancel/Retry/Ignore

  • Prompt With Multiple Selection: Prompting with a set of answers defined by the programmer

  • Prompt With Additional Controls: Additional input fields of any type can be entered in a window.

Key

Key for identifying the message

Example: Warning_Var

To determine this value, you need to know which key is used for calling the message in the implementation (IMessageService3).

Message

Message key for identifying the message

The wildcards "*" and "?" are permitted.

Prompt Result

If the Forward option is disabled, then this column determines how the message is answered for Prompt windows. The following possibilities are available:

  • Abort

  • Cancel

  • Ignore

  • No

  • OK

  • Retry

  • Yes

Optional

standard icon: If there is no suitable message for this filter, then this does not fail for one of the actions InstallMessagehandler or UninstallAndCheckMessageHandler.

_cds_icon_option_deactivated.png: If there is no suitable message for this filter, then this fails for the action UninstallAndCheckMessageHandler.

Next

standard icon: The corresponding message is displayed to the user for selection, or in the case of nesting, forwarded to the next handler.

Multiple

standard icon: The message can be displayed multiple times.

_cds_icon_option_deactivated.png: If the message is displayed more than one time, then the UninstallAndCheckMessageHandler action fails.

Multiple Choice Result

Defines the return value for multiple selection prompts

The options are numbered consecutively from zero.

Additional Controls

Add: Double-clicking opens a window for configuring additional input fields.

  • Identifier: Identifier of the input field

  • Value: Value which is assigned to the input field, which is addressed by means of the identifier

  • Remove: Deletes the selected assignment of identifier and value

  • Clear: Deletes all assignments

All other messages

Handling of messages which have not been captured by any of the defined filters

  • Report as error: Causes the action to fail

  • Acknowledge: Ends these dialogs with the default selection

  • Forward (show message box): Displays the dialog blocking on the screen or forwards it to the next handler in the case of nesting

Tab: Parameters

The parameters defined on the Parameters tab are used to exchange values between test script variables and parameters of test actions. Parameters can be used as placeholders on the Configuration tab. For this, the name of the parameter is set in braces in the configuration dialog. Example: {name}.

Tip

Variables defined globally in the script (with the prefix $GLOBALS.) can be used directly in the test action. It is not necessary to use input parameters for passing. Using output parameters is necessary for writing global variables.

Input parameters: When executing the test action, the values of the test script variables are passed to the input parameters of the test action and can be used in the configuration of the test action.

Output parameters: When executing the test action, the values of the output parameters of the test action are passed to the test script variables and can be used (for example, in other test actions).

Name

Name of the input/output parameter

This name is defined in addition to the variable name to identify the origin of the parameter when it is passed to another script. During the test run, this name is displayed as the Outer name on the Variables (scope #<n>) tab in the Test progress window.

Background: When a script A calls another script B, and its variable x passes y as a parameter to the script B, then the parameter y is the variable y from the point of view of script B.

To see that this variable is recognized as variable x "outside" of script B, there is the Name column ("Outer name"). The variable y has the name x in the scope pf script B because it has been passed as variable x to the parameter y in the scope of the calling script A.

Variable

Name of the test script variable

Example: TS_CaseA_Result

Move Up

Moves the selected variable one line up

Move Down

Moves the selected variable one line down

Remove

Removes the selected variable from the list