0
我使用的自动化UI,并添加像UIAUOMATION CLIETNT和所有refrences类型,但我的功能自动化事件不起作用? C#自动化UI
Automation.AddAutomationEventHandler(
WindowPattern.WindowOpenedEvent,
AutomationElement.RootElement,
System.Windows.Automation.TreeScope.Subtree,
(sender, e) =>
{
var element = sender as AutomationElement;
if (element.Current.LocalizedControlType == "Dialog")
{
}
});
System.Console.ReadKey();
Automation.RemoveAllEventHandlers();
停止像开了一些对话,请保存,prefrences但对于其他人对话的工作我是注册事件所以我的事件也是强制性的,因为对话框需要注意的点
System.Console.Read();
Automation.RemoveAllEventHandlers();
1-以上代码system.console.ReadKey();也给出了错误,因为它是在web服务没有控制台模式
2,打开和保存对话都没有检测
3,并且也很慢
类似问题
NO AUTOMATION GURU –