Example #1
0
 public static IReadOnlyList <T> GetMultiple <T>(this UIItemContainer container, string automationId)
     where T : IUIItem
 {
     return(container.GetMultiple(SearchCriteria.ByAutomationId(automationId))
            .OfType <T>()
            .ToList());
 }
Example #2
0
        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);
        }
Example #3
0
 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());
 }
Example #5
0
        public static IUIItem[] GetMultiple(this UIItem uiItem, SearchCriteria criteria)
        {
            UIItemContainer uiItemContainer = GetUiItemContainer(uiItem);

            return(uiItemContainer.GetMultiple(criteria));
        }
Example #6
0
        public static IUIItem[] GetChildren(this IUIItem parent, SearchCriteria searchCriteria)
        {
            var parentContainer = new UIItemContainer(parent.AutomationElement, parent.ActionListener);

            return(parentContainer.GetMultiple(searchCriteria));
        }