コード例 #1
0
        public static PageElementCollection GetElementCollectionByAlias(PageCore page, PageElement currentElement, string groupAlias)
        {
            if (page == null)
            {
                throw new ArgumentException("Страница на которой происходит поиск не может иметь пустое значение");
            }

            PageElementCore element = null;

            if (currentElement != null && currentElement.TryFindElementByAlias(groupAlias, out element))
            {
                PageElementCollection collection = element as PageElementCollection;
                if (collection != null)
                {
                    return(collection);
                }
            }
            if (page.TryFindElementByAlias(groupAlias, out element))
            {
                PageElementCollection collection = element as PageElementCollection;
                if (collection != null)
                {
                    return(collection);
                }
            }

            string xPath = Alias.ResolveAsString(groupAlias);

            return(page.FindElementCollection(xPath));
        }
コード例 #2
0
        public static PageElementCollection GetElementCollectionByAlias(string groupAlias)
        {
            PageCore              currentPage    = ScenarioContext.Current.Page();
            PageElement           currentElement = ScenarioContext.Current.Element();
            PageElementCollection element        = GetElementCollectionByAlias(currentPage, currentElement, groupAlias);

            return(element);
        }
コード例 #3
0
 public static void SetElementGroup(this ScenarioContext context, PageElementCollection group)
 {
     context[CURRENT_ELEMENT_GROUP_KEY] = group;
     context.Remove(CURRENT_ELEMENT_KEY);
 }