Exemple #1
0
        public static T GetSibling <T>(this IUIItem childElement, SearchCriteria searchCriteria) where T : IUIItem
        {
            var element         = childElement.GetParent <IUIItem>();
            var parentContainer = new UIItemContainer(element.AutomationElement, element.ActionListener);

            return((T)parentContainer.Get(searchCriteria));
        }
Exemple #2
0
        public static IEnumerable <IUIItem> Ancestors(this IUIItem item)
        {
            var parent = item.GetParent <IUIItemContainer>();

            while (parent != null)
            {
                yield return(parent);

                parent = parent.GetParent <IUIItemContainer>();
            }
        }