【发布时间】:2011-03-15 12:36:40
【问题描述】:
我正在尝试自动化安装向导,我需要单击一个未启用的按钮。
我知道这可以使用 Windows 消息来完成,但我想知道 White 或 UIAutomation 是否已经对此提供支持
仅供参考,这不起作用:
var invoke = (System.Windows.Automation.InvokePattern)setup.button("Next >").AutomationElement.GetCurrentPattern(System.Windows.Automation.InvokePattern.Pattern);
invoke.Invoke();
也没有
var guiAutomation = new API_GuiAutomation("msiexec");
var setup = guiAutomation.windows()[0];
setup .bringToFront();
setup .button("Next >").mouse().click(); // this will work
setup .button("Next >").mouse().click(); // this will not work since the button is not enabled
上面的示例使用了我添加到 O2 Platform 的基于 White 的 API(请参阅此处的 example of automating notepad)
【问题讨论】:
标签: c# ui-automation white-framework