ElementAvailable

Top  Previous  Next

×V5.3Ø

S

A

W

WS

M

 

 

ü

Syntax -

If ElementAvailable <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> is available to interact with in the windows application.  Checking for the availability of an element is useful in determining that the script is able to click on or type into a control and prevents an error if the element is disabled.  This operator also allows the script to determine the behavior in the case that the element is disabled.

The optional <timeout> parameter allows the user to define a delay (in milliseconds) that the script will wait if the element is disabled.  If the element is available sooner, the script will proceed.  If the element is not enabled 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 become available for a period of time defined by ElementTimeout before evaluating the IF statement.

 

Sample:

       The following IF statement will look to see if the edit field is enabled in the RevCycle app.

If ElementAvailable 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:

OpenApp