internal static IEnumerable <CruciatusElement> FindAll(CruciatusElement parent, By getStrategy, int timeout)
        {
            if (parent == null)
            {
                throw new ArgumentNullException("parent");
            }

            var element = parent.Instance;
            var info    = getStrategy.FindInfoList;

            for (var i = 0; i < info.Count - 1; ++i)
            {
                element = AutomationElementHelper.FindFirst(element, info[i].TreeScope, info[i].Condition, timeout);
                if (element == null)
                {
                    Logger.Error("Element '{0}' not found", info);
                    CruciatusFactory.Screenshoter.AutomaticScreenshotCaptureIfNeeded();
                    throw new CruciatusException("ELEMENT NOT FOUND");
                }
            }

            var lastIinfo = getStrategy.FindInfoList.Last();
            var result    = AutomationElementHelper.FindAll(element, lastIinfo.TreeScope, lastIinfo.Condition);

            return(result.Select(e => new CruciatusElement(parent, e, getStrategy)));
        }
예제 #2
0
 internal override IEnumerable <AutomationElement> FindAll(AutomationElement parent, int timeout)
 {
     return(AutomationElementHelper.FindAll(parent, this.xpath, timeout));
 }
예제 #3
0
 internal override AutomationElement FindFirst(AutomationElement parent, int timeout)
 {
     return(AutomationElementHelper.FindAll(parent, this.xpath, timeout).FirstOrDefault());
 }
예제 #4
0
 internal override IEnumerable <AutomationElement> FindAll(AutomationElement parent, int timeout)
 {
     return(AutomationElementHelper.FindAll(parent, this.scope, this.GetCondition(), timeout));
 }