CompareValue
You use the CompareValue keyword to compare a variable value with the expected value. The expected value can be a variable or value.
Signature
The CompareValue keyword supports the following signature:
CompareValue(@Variable|Operator|value (or) @Variable)
Operator can be one of the following characters or values:
-
=
(equals) -
>
(greater than) -
<
(less than) -
<=
(less than or equal to) -
>=
(greater than or equal to) -
contains
-
startswith
-
endswith
Desktop Examples
The following table describes how to use the CompareValue keyword to compare a variable value with the expected value for desktop applications.
Target Object | Inputs | Closing Action | Comments |
---|---|---|---|
N/A |
@var1|>=|3.56 |
N/A |
Verifies a variable value by comparing it with the expected value 3.56. |
N/A |
@Var1|=|@Var2 |
N/A |
Verifies a variable value by comparing it with the expected value. |
N/A |
@Var|startswith|nc |
N/A |
Verifies a variable value by comparing it with the expected value that starts with nc. |
N/A |
@Var|endswith|nc |
N/A |
Verifies a variable value by comparing it with the expected value that ends with nc. |
N/A |
@Var|=|{[123]} |
N/A |
Verifies a variable value by comparing it with the expected value. |
N/A |
@Var|=|"text123; |
N/A |
Verifies a variable value by comparing it with the expected value text123. |
Mobile Examples
The following table describes how to use the CompareValue keyword to compare a variable value with the expected value for mobile applications (on mobile devices).
Target Object | Inputs | Closing Action | Comments |
---|---|---|---|
N/A |
@var1|>=|3.56 |
N/A |
Verifies a variable value by comparing it with the expected value 3.56. |
N/A |
@Var1|=|@Var2 |
N/A |
Verifies a variable value by comparing it with the expected value. |
N/A |
@Var|startswith|nc |
N/A |
Verifies a variable value by comparing it with the expected value that starts with nc. |
N/A |
@Var|endswith|nc |
N/A |
Verify a variable value by comparing it with the expected value that ends with nc. |
N/A |
@Var|=|{[123]} |
N/A |
Verifies a variable value by comparing it with the expected value. |
N/A |
@Var|=|"text123; |
N/A |
"Verifies a variable value by comparing it with the expected value text123. |