AssertMsg

The AssertMsg method can be used to verify the result of a test preparation step and, if an error occurs, to display a custom error message. It therefore extends the functionality of the “Assert” method to include an error message.
Syntax
METHOD AssertMsg
VAR_INPUT
condition : BOOL
message : STRING(255) := '';
END_VAR
Inputs
Name | Type | Description |
|---|---|---|
condition | BOOL | A BOOL value that indicates whether the test was successful. |
message | STRING(255) | Error message if the test fails. |
Example
AssertMsg(condition:=condition, message:= ‘Error message to be displayed in the client!');