public static IReadOnlyList <T> GetMultiple <T>(this UIItemContainer container, string automationId) where T : IUIItem { return(container.GetMultiple(SearchCriteria.ByAutomationId(automationId)) .OfType <T>() .ToList()); }
public static List <T> GetChildren <T>(this IUIItem parent, SearchCriteria searchCriteria) where T : IUIItem { var resultingList = new List <T>(); var parentContainer = new UIItemContainer(parent.AutomationElement, parent.ActionListener); var items = parentContainer.GetMultiple(searchCriteria); foreach (var item in items) { resultingList.Add((T)item); } return(resultingList); }
public static IReadOnlyList <string> GetChildren(this UIItemContainer container) { return(container.GetMultiple <Label>("ChildTextBlock") .Select(x => x.Text) .ToList()); }
public static IReadOnlyList <string> GetErrors(this UIItemContainer page) { return(page.GetMultiple <Label>(AutomationIDs.ErrorText) .Select(x => x.Text) .ToList()); }
public static IUIItem[] GetMultiple(this UIItem uiItem, SearchCriteria criteria) { UIItemContainer uiItemContainer = GetUiItemContainer(uiItem); return(uiItemContainer.GetMultiple(criteria)); }
public static IUIItem[] GetChildren(this IUIItem parent, SearchCriteria searchCriteria) { var parentContainer = new UIItemContainer(parent.AutomationElement, parent.ActionListener); return(parentContainer.GetMultiple(searchCriteria)); }