开发者

Handling UAC prompts when doing UIAutomation

Is there a way to access the UAC prompts via UIAutomation (I'm writing a test for an installation process).

From http://msdn.microsoft.com/en-us/library/ms742884.aspx it looks like there is a way to set this up.

So the question is how to make this automatically?开发者_高级运维

My current UIAutomation setup is made of the amazing White API (white.codeplex.com) with a bunch of extension methods from the O2 Platform


For security reasons, this is guaranteed to be impossible.

The whole point of UAC is that programs cannot automatically click Allow.


Not exactly the answer you'd have liked but a workaround based on SLaks's answer (Thanks @SLaks for answer) i.e. for security reasons Windows wouldn't allow automated clicks on the 'yes'. In that case if bypassing is the only option we could have same effect as elevated prompt and clicked yes by setting "UAC: Behaviour of elevation prompt for administrators in Admin Approval Mode" to 'Elevate without prompting' in security policy. I tried this in my automated tests and they are giving me same effect as clicking 'yes' on that prompt if it was prompted. Of course it isn't prompting since I've changed that option.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜