Home > FAQ > Useful Basic Tasks when writing a script > How do I find the window which has the focus?

UIA Element Not Found

The functions dealing with UI Automation elements within the desktop: provide synchronization within the script, temporarily blocking script execution until the UI Automation element as specified by its UIA Descriptor is completely loaded AND VISIBLE

If the UI Automation element as specified by its UIA descriptor cannot be loaded within the default timeout period of 30 seconds or is not visible after 30 seconds, the function will fail. This default timeout can be increased via the #ActionTimeout system variable. The #ActionTimeout variable can be increased just before the function and then restored to it's original value immediately following it.

Another possible reason for the UIA Element not found error is when a property used by the UIA descriptor has changed.

Use the following step-by-step instructions to help diagnose and correct the problem.

See also