ElementExists |
Top Previous Next |
×V5.3Ø
Syntax - If ElementExists <App Name> <Element Identifier> [<Timeout>] ... Where: <App Name> The name that represents an opened application. <Element Identifier> is a valid element identifier as described in Element Strings and References. <Timeout> is a integer or a variable that contains an integer.
Description: This comparison operator is used to determine if the element defined by <Element Identifier> appears in the windows application. Checking for the existence of an element is useful in determining that the script is executing on the correct screen and prevents an error if the element does not exist. This operator also allows the script to determine the behavior in the case that the element does not exist. The optional <timeout> parameter allows the user to define a delay (in milliseconds) that the script will wait if the element is not present immediately. If the element appears sooner, the script will proceed. If the element does not appear after the delay, then the script will follow the logic defined in the IF statement. If this parameter is not defined, then EMUE will wait for the element to appear for a period of time defined by ElementTimeout before evaluating the IF statement.
Sample: The following IF statement will look for the existence of a specific edit field in the RevCycle app. If ElementExists RevCycle "Element[Name=Username:|Type=Edit]" 60000 Then TypeValue UserName RevCycle "Element[Name=Username:|Type=Edit]" TypeValue Password RevCycle "Element[Name=Password:|Type=Edit]" ClickElement RevCycle "Element[Name=OK|Type=Button]" EndIf
Control Usage: This works on all supported control types. This operator can be used inside of a complex if statement.
See Also:
|