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.
- Execute the script in question.
- When the script fails and displays the error message, click the OK button to dismiss the message box. Leave the window open on the application under automation.
- If it appears that the windows is not ready for input, or the wrong window is displayed, you may have a synchronization error. See above how to increase the default timeout. Continue with the next step if the problem persists.
- If the correct window page is displayed and the UIA element to click is there and visible, there may be a problem with the UIA Descriptor. Bring up the WinTask x64 Editor and create a new script.
- Spy in this new script the element you want to click, paste the new generated UIA descriptor and add the UIA function you want to use.
- Restore the window in the application to the state it was at when the failure occurred.
- Save the newly recorded script. Compile and execute the script.
- If the new script replays correctly, compare the newly generated UIA Descriptor with the corresponding one in the script with the error. If the UIA Descriptors are identical, a synchronization error is the likely cause.
- If the UIA Descriptor in the new script differs from the original script, update the original script so the UIA Descriptor matches the new script. Recompile and execute the script.
- If the script still fails after trying all of the above recommendations, please contact us at for further assistance.