Ejemplo n.º 1
0
        private TypifiedElement DecorateTypifiedElement(Type elementType, IElementLocator locator, string elementName)
        {
            // Create typified element and initialize it with WebElement proxy
            IWebElement     elementToWrap           = HtmlElementFactory.CreateNamedProxyForWebElement(locator, elementName);
            TypifiedElement typifiedElementInstance = HtmlElementFactory.CreateTypifiedElementInstance(elementType, elementToWrap);

            typifiedElementInstance.Name = elementName;
            return(typifiedElementInstance);
        }
        private IList <TypifiedElement> GetElements()
        {
            IList <TypifiedElement> typifiedElements = new List <TypifiedElement>();
            IList <IWebElement>     elements         = locator.FindElements();
            int elementNumber = 0;

            foreach (IWebElement element in elements)
            {
                TypifiedElement typifiedElement     = HtmlElementFactory.CreateTypifiedElementInstance(elementType, element);
                string          typifiedElementName = string.Format("{0} {1}", name, elementNumber);
                typifiedElement.Name = typifiedElementName;
                typifiedElements.Add(typifiedElement);
                elementNumber++;
            }
            return(typifiedElements);
        }