4

私はこれが初めてです。UI オートメーションを使用してアプリケーションを自動化しています。複数の識別子に基づいて要素を識別する方法はありますか。現在、以下の構文は、1 つの識別子に基づいてのみ識別できます。

AutomationElement okbtn = dialogbox.FindFirst(TreeScope.Children, new PropertyCondition(AutomationElement.NameProperty, "OK"));

NameProperty と ControlTypeProperty の両方で要素を識別したいと思います。

これは可能ですか?

4

1 に答える 1

11
        Condition cMenuItem = new AndCondition(
            new PropertyCondition(AutomationElement.LocalizedControlTypeProperty,"text"),
            new PropertyCondition(AutomationElement.NameProperty,"Appointment"));

        AutomationElement aeMenuItem = aeTaskMenu.FindFirst(TreeScope.Descendants, cMenuItem);
于 2011-04-29T06:49:48.237 に答える