public ComponentsList( FindStrategy by, IWebElement parenTComponent, bool shouldCacheFoundElements) : this(by, parenTComponent) { _shouldCacheFoundElements = shouldCacheFoundElements; }
public ComponentsList( FindStrategy by, IWebElement parenTComponent) { _by = by; _parenTComponent = parenTComponent; _foundElements = new List <TComponent>(); WrappedDriver = ServicesCollection.Current.Resolve <IWebDriver>(); }
public dynamic CreateElementThatIsFound(FindStrategy by, IWebElement webElement, Type newElementType, bool shouldCacheElement) { DetermineElementAttributes(out var elementName, out var pageName); dynamic element = Activator.CreateInstance(newElementType); element.By = by; element.WrappedElement = webElement; element.ElementName = string.IsNullOrEmpty(elementName) ? $"control ({by})" : elementName; element.PageName = pageName ?? string.Empty; element.ShouldCacheElement = shouldCacheElement; return(element); }
public TElementType CreateElementThatIsFound <TElementType>(FindStrategy by, IWebElement webElement, bool shouldCacheElement) where TElementType : Element { DetermineElementAttributes(out var elementName, out var pageName); var element = Activator.CreateInstance <TElementType>(); element.By = by; element.WrappedElement = webElement; element.ElementName = string.IsNullOrEmpty(elementName) ? $"control ({by})" : elementName; element.PageName = pageName ?? string.Empty; element.ShouldCacheElement = shouldCacheElement; return(element); }
public TComponentType CreateComponentWithParent <TComponentType>(FindStrategy by, IWebElement parenTComponent, IWebElement foundElement, int elementsIndex, bool shouldCacheElement) where TComponentType : Component { DetermineComponentAttributes(out var elementName, out var pageName); var element = Activator.CreateInstance <TComponentType>(); element.By = by; element.ParentWrappedElement = parenTComponent; element.WrappedElement = foundElement; element.ElementIndex = elementsIndex; element.ComponentName = string.IsNullOrEmpty(elementName) ? $"control ({by})" : elementName; element.PageName = pageName ?? string.Empty; element.ShouldCacheElement = shouldCacheElement; return(element); }