/// <summary> /// Decorates the typified element. /// </summary> /// <param name="elementType">Type of the element.</param> /// <param name="locator">The locator.</param> /// <param name="elementName">Name of the element.</param> /// <returns>The value.</returns> private TypifiedElement DecorateTypifiedElement(Type elementType, IElementLocator locator, string elementName) { // Create typified element and initialize it with WebElement proxy var elementToWrap = HtmlElementFactory.CreateNamedProxyForWebElement(locator, elementName); var typifiedElementInstance = HtmlElementFactory.CreateTypifiedElementInstance(elementType, elementToWrap); typifiedElementInstance.Name = elementName; return(typifiedElementInstance); }
/// <summary> /// Decorates the HTML element. /// </summary> /// <param name="elementType">Type of the element.</param> /// <param name="locator">The locator.</param> /// <param name="elementName">Name of the element.</param> /// <returns>The value.</returns> private HtmlElement DecorateHtmlElement(Type elementType, IElementLocator locator, string elementName) { // Create block and initialize it with WebElement proxy var elementToWrap = HtmlElementFactory.CreateNamedProxyForWebElement(locator, elementName); var htmlElementInstance = HtmlElementFactory.CreateHtmlElementInstance(elementType); htmlElementInstance.WrappedElement = elementToWrap; htmlElementInstance.Name = elementName; // Recursively initialize elements of the block PageFactory.InitElements(new HtmlElementDecorator(elementToWrap), htmlElementInstance); return(htmlElementInstance); }
/// <summary> /// Decorates the web element. /// </summary> /// <param name="locator">The locator.</param> /// <param name="elementName">Name of the element.</param> /// <returns>The value.</returns> private IWebElement DecorateWebElement(IElementLocator locator, string elementName) { return(HtmlElementFactory.CreateNamedProxyForWebElement(locator, elementName)); }