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

VerifyIsLessOrEqual

Verifies that the first expression is less than or equal to the second expression.

Definition

Namespace: UiPath.Testing.API

Assembly: UiPath.Testing.Activities.Api (in UiPath.Testing.Activities.Api.dll)

VerifyIsLessOrEqual(object, object, string)

bool VerifyIsLessOrEqual(
       object firstExpression,
       object secondExpression
       string outputMessageFormat = null
)bool VerifyIsLessOrEqual(
       object firstExpression,
       object secondExpression
       string outputMessageFormat = null
)
firstExpression Object
The first expression in the verification process.
secondExpression Object
The second expression in the verification process.
outputMessageFormat String
The format of the output message. The supported arguments are:
  • {LeftExpression}
  • {LeftExpressionText}
  • {RightExpression}
  • {RightExpressionText}
  • {Result}

For more information, check the Configuring the outputMessageFormat section.

Return value

It is True if the first expression is less than or equal to the second expression , and False if the first expression is greater than the second expression.

Configuring the outputMessageFormat

The outputMessageFormat parameter 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 defined when invoking the API at runtime.

For the VerifyIsLessOrEqual API, 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 parameter.
  • {LeftExpressionText}: Represents the text of the first expression you inserted for the firstExpression parameter.
  • {RightExpression}: Represents the value of the second expression you provided for the secondExpression parameter.
  • {RightExpressionText}: Represents the text of the second expression you inserted for the secondExpression parameter.
  • {Result}: Represents the API's return value, which is the verification result.
The following is an example on how to use the VerifyIsLessOrEqual API, which includes configuring the outputMessageFormat parameter:
// Initialize variables for the expressions to be verified
var expression1 = 4;
var expression2 = 5;

// Employ the VerifyIsLessOrEqual API, with the last string parameter being the outputMessageFormat
testing.VerifyIsLessOrEqual(expression1, expression2, "{LeftExpression} should be lower than {LowerLimitText}, and the result to this is {Result}");// Initialize variables for the expressions to be verified
var expression1 = 4;
var expression2 = 5;

// Employ the VerifyIsLessOrEqual API, with the last string parameter being the outputMessageFormat
testing.VerifyIsLessOrEqual(expression1, expression2, "{LeftExpression} should be lower than {LowerLimitText}, and the result to this 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.