Some additional info: The above solution does not work for the UAC prompt. The “User Account Control” (UAC) prompt is designed to avoid automation. How to bypass the UAC prompt is a challenge for all automation tools.
Workarounds:
- Connect to the machine via remote control (e. g. Teamviewer or Anydesk). Then you can automate the machine under test remotely/visually with UI Vision. This includes pressing the UAC buttons.
Other workarounds:
-
Disable the local security policy “Run all administrators in Admin Approval Mode”
-
Turn UAC off in registry. This is not recommended, and is not feasible on Windows 8 or later.