/// <summary> /// Only use this constructor overload if you are also using FlexibleSelenium.StaticDriver to manage your driver instance /// </summary> public PageElement(PageElement contextElement, By targetBy) { ThisDriver = Driver.Instance; Context = contextElement; TargetBy = targetBy; WaitMilliseconds = Driver.WaitMilliseconds; }
/// <summary> /// Only use this constructor overload if you are also using FlexibleSelenium.StaticDriver to manage your driver instance /// </summary> public PageElement(By contextBy, By targetBy) { ThisDriver = Driver.Instance; Context = new PageElement(contextBy); TargetBy = targetBy; WaitMilliseconds = Driver.WaitMilliseconds; }
public PageElement(PageElement contextElement, By targetBy, int waitMilliseconds) { ThisDriver = contextElement.ThisDriver; TargetBy = targetBy; Context = contextElement; WaitMilliseconds = waitMilliseconds; }
public PageElement(IWebDriver driver, By contextBy, By targetBy, int waitMilliseconds) { ThisDriver = driver; TargetBy = targetBy; Context = new PageElement(driver, contextBy, waitMilliseconds); WaitMilliseconds = waitMilliseconds; }
/// <summary> /// Evaluates whether the childElement is both IsPresent and within the scope of this PageElement's BaseElement. /// </summary> public bool Contains(PageElement childElement) { if (this.IsPresent(WaitMilliseconds)) { if (childElement.IsPresent(WaitMilliseconds)) { var allDesendantElements = this.BaseElement.GetDescendants(); return(allDesendantElements.Contains(childElement.BaseElement)); } else { return(false); } } else { throw new NoSuchElementException("The proposed parent element is not present, and thus cannot contain any children elements"); } }
public bool Contains(By childBy) { var childElement = new PageElement(childBy); return(Contains(childElement)); }