現在、下記サイトのサンプルを使用し、クリックされたコントロールのAutomationIdを取得しようとしていますが、Windowsフォーム上のコントロールのAutomationIdは問題なく取得出来ているのですが、IE上のコントロール(テキストボックス)のAutomationIdはブランクとなっており、取得できません。(Name、FrameworkIdもブランクです。)
Windows SDKにあるInspectではWindowsフォーム、IE関係なく、ちゃんとAutomationIdが取得出来ていますが、何かやり方がおかしいのでしょうか。
もしくは、そもそもUIAutomationでは、IE上のコントロールは対応していないでしょうか。
サイト
https://docs.microsoft.com/ja-jp/previous-versions/dotnet/netframework-3.5/aa358508(v=vs.90)
ソース
private void OnFocusChanged(object src, AutomationFocusChangedEventArgs e)
{
focusedElement = src as AutomationElement;
focusedRect = focusedElement.Current.BoundingRectangle;
Console.WriteLine("Name : " + focusedElement.Current.Name); Console.WriteLine("AutomationId : " + focusedElement.Current.AutomationId); Console.WriteLine("FrameworkId : " + focusedElement.Current.FrameworkId); if (useTimer) { eventTimer.Interval = timerInterval; eventTimer.Start(); } else { UpdateHighlight(); } }
宜しくお願いします。
あなたの回答
tips
プレビュー