1
왜 UIAutomation이 크롬의 상황에 맞는 메뉴 요소를 가져올 수 없습니까?Microsoft ui-automation이 크롬의 상황에 맞는 메뉴 요소를 가져올 수 없습니다.
C# 코드 : 아래 코드는 루트 요소에 가입합니다.
public void SubscribeToInvoke()
{
Automation.AddAutomationEventHandler(AutomationElement.MenuOpenedEvent,
AutomationElement.RootElement,
TreeScope.Descendants, UIAEventHandler);
Automation.AddAutomationEventHandler(AutomationElement.MenuClosedEvent,
AutomationElement.RootElement,
TreeScope.Descendants, UIAEventHandler);
}
벨로우즈 이벤트
구글 크롬의 경우 해고되지 않지만, 다른 경우 (즉, IE 나 파이어 폭스 나 다른 응용 프로그램)에 괜찮습니다. private void UIAEventHandler(object sender, AutomationEventArgs e)
{
AutomationElement sourceElement;
sourceElement = sender as AutomationElement;
if (e.EventId == AutomationElement.MenuOpenedEvent)
{
}
else if (e.EventId == AutomationElement.MenuClosedEvent)
{
}
}
코드 변경이 필요하거나이 문제에 대한 대안이 있습니까?