Skip to main content

Wait for Desktop Element

Pauses until a desktop element appears or disappears, then continues immediately. Polls inside the robot, so it reacts within a fraction of a second; the same wait built from Check Element Exists in a loop costs a round trip per look. Returns true when the state arrived, false when the timeout ran out first (Windows only).

Category: Desktop Application Automation · Group: Desktop · Activity name: WaitForDesktopElement

Example​

outputVariable = WaitForDesktopElement("<xPath>", state="appears", timeout=15000, pollInterval=200, checkOrphanedElements=False)

Inputs​

NameTypeRequiredDefaultDescription
XPathstringYesXPath expression that identifies the target element.
Element StatestringappearsWhether to wait for the element to show up or to go away. One of: appears, disappears.
Timeout (ms)integer15000How long to keep looking before giving up and returning false. Default 15000.
Poll interval (ms)integer200How long to pause between looks. Default 200; anything under 50 is raised to it.
Check orphaned elementsbooleanFalseWhen the element is not found by its XPath, scan the parent window's area for elements detached from the UI Automation tree. Slower; enable only for windows known to orphan their elements.

Outputs​

NameTypeDescription
outputVariablebooleanSpecifies the name of the variable that will store whether the state arrived before the timeout.