User Case

In this case, we have to check for a value, but we are not sure what type of value this is. Therefore, how could we check if this value is an integer?

Example: Enter a value in textbox of Notepad and check it.


Solution

There are 2 options:

1. Using a regular expression

AUT: textbox of notepad

 


Result by using regular expression:


 

^ It matches the starting position of any line

[0-9]  The bracket expression matches a single character that is contained within 0,1,2,3,4,5,6,7,8,9

+                     The plus sign indicates there is one or more of the preceding element

$                      It matches the ending position of any line

Note: To be able to use regular expression in TA, you must put the value in “{ }”

2. Using an automation harness

Please take a look at Using an automation harness for more information