activities
latest
false
UiPath logo, featuring letters U and I in white
Workflow Activities
Last updated Nov 18, 2024

Verify Expression With Operator

UiPath.Testing.Activities.VerifyExpressionWithOperator

Description

Verifies an expression by asserting it in relation to a given expression with an operator. The expressions tested with this activity must be inserted in their respective property fields.

Project compatibility

Windows - Legacy | Windows | Cross-platform

Windows - Legacy configuration

Designer panel
  • FirstExpression - The first expression in the verification process.
  • Operator - A drop-down list containing all of the possible mathematical operators you can use to verify the two expressions. The following options are available:

    • Equality
    • Inequality
    • GreaterThan
    • GreaterThanOrEqual
    • LessThan
    • LessThanOrEqual
      • SecondExpression - The second expression in the verification process.
      • TakeScreenshotIfFailed - If set to True, takes a screenshot of the target process if the verification has failed.
      • TakeScreenshotIfSucceded - If set to True, takes a screenshot of the target process if the verification has been successful.
Properties panel

Common

  • DisplayName - The display name of the activity.

Input

  • ContinueOnFailure - Specifies if the automation should continue even when the activity throws an error. This field only supports Boolean values (True, False). The default value is True. As a result, the execution of the project continues regardless of any error. If the value is set to False, and an error is thrown, the execution of the project stops.
    Note: If this activity is included in Try Catch and the value of the ContinueOnFailure property is True, no error is caught when the project is executed.
  • FirstExpression - The first expression in the verification process.
  • Operator - A drop-down list containing all of the possible mathematical operators you can use to verify the two expressions. The following options are available:

    • Equality
    • Inequality
    • GreaterThan
    • GreaterThanOrEqual
    • LessThan
    • LessThanOrEqual

      • SecondExpression - The second expression in the verification process.
      • TakeScreenshotIfFailed - If set to True, takes a screenshot of the target process if the verification has failed.
      • TakeScreenshotIfSucceded - If set to True, takes a screenshot of the target process if the verification has been successful.

Messages

  • AlternativeVerificationTitle - Specifies an alternative display name. This property overrides the default DisplayName, which is the verification activity name that shows up in Orchestrator.
  • OutputMessageFormat - Specifies the format of the output message. To set a global output message format, see Project Settings.

    For more information, check the Configuring the OutputMessageFormat section.

Misc

  • Private - If selected, the values of variables and arguments are no longer logged at Verbose level.

Output

  • Result - Reflects the state of the verification activity. You can use this to send notifications or create reports for failed verifications.

Windows, Cross-platform configuration

  • FirstExpression - The first expression in the verification process.
  • Operator - A drop-down list containing all of the possible mathematical operators you can use to verify the two expressions. The following options are available:

    • Equality
    • Inequality
    • GreaterThan
    • GreaterThanOrEqual
    • LessThan
    • LessThanOrEqual
  • SecondExpression - The second expression in the verification process.

    • TakeScreenshotIfFailed - If set to True, takes a screenshot of the target process if the verification has failed.
    • TakeScreenshotIfSucceded - If set to True, takes a screenshot of the target process if the verification has been successful.
Advanced options

Input

  • ContinueOnFailure - Specifies if the automation should continue even when the activity throws an error. This field only supports Boolean values (True, False). The default value is False. As a result, if the field is blank and an error is thrown, the execution of the project stops. If the value is set to True, the execution of the project continues regardless of any error.
  • TakeScreenshotIfFailed - If set to True, takes a screenshot of the target process if the verification has failed.
  • TakeScreenshotIfSucceded - If set to True, takes a screenshot of the target process if the verification has been successful.

Messages

  • AlternativeVerificationTitle - Specifies an alternative display name. This property overrides the default DisplayName, which is the verification activity name that shows up in Orchestrator.
  • OutputMessageFormat - Specifies the format of the output message. To set a global output message format, see Project Settings.

Output

  • Result - Reflects the state of the verification activity. You can use this to send notifications or create reports for failed verifications.

Wildcard characters

Use wildcard characters to match unknown or any values when you verify variables of type String. You can concatenate wildcard characters at the beginning, in the middle, or at the end of a string (e.g., "abc?" = "abc*").
Conditions
  • To match wildcards as literals, you need to escape them.
  • Only the second expression allows for wildcard usage.
Supported wildcards

Wildcard character

Description

# (number sign)

Matches a single character (e.g., `[0-9]{1

? (question mark)

Matches a single alphanumeric character.

*(asterisk)

Matches zero or more alphanumeric characters.

Use case scenario

In the following example, the # and * wildcards have been used to match known values found in the first expressions.


Configuring the OutputMessageFormat

The OutputMessageFormat property can be configured with supported arguments, that act as placeholders for the values used in the verification operation. These placeholders are automatically populated with the variables or values you defined when invoking the activity at runtime.

For the Verify Expression With Operator activity, you can implement the following supported arguments when creating an output message:

  • {LeftExpression}: Represents the value of the first expression you provided for the FirstExpression property.
  • {LeftExpressionTextName}: Represents the text of the first expression you inserted for the FirstExpression property.
  • {RightExpression}: Represents the value of the second expression you provided for the SecondExpression property.
  • {RightExpressionText}: Represents the text of the second expression you inserted for the SecondExpression property.
  • {Result}: Represents the activity output value, which is the verification result.
  • {Operator}: Represents the operator used in the verification, set by the Operator property.
The following is an example on how to configure an output message for the Verify Expression with Operator activity: "{LeftExpression} {Operator} the {RightExpression}, so the verification is {Result}."

In the provided example, the placeholders within the curly brackets are replaced with the corresponding variable names and their values at runtime, providing a customized output message.

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.