Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UI Automation - Select object based on multiple Identifiers

I am new to this. I am using UI Automation to automate my application. Is there a way to identify element based on multiple identifier. currently the below syntax only able to identify based on one identifier.

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

I would like to take identify element by both NameProperty and ControlTypeProperty.

Is this possible?

like image 244
kumar Avatar asked Dec 22 '22 14:12

kumar


1 Answers

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

        AutomationElement aeMenuItem = aeTaskMenu.FindFirst(TreeScope.Descendants, cMenuItem);
like image 150
kumar Avatar answered Mar 04 '23 21:03

kumar