Example #1
0
 /// <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;
 }
Example #2
0
 /// <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;
 }
Example #3
0
 public PageElement(PageElement contextElement, By targetBy, int waitMilliseconds)
 {
     ThisDriver       = contextElement.ThisDriver;
     TargetBy         = targetBy;
     Context          = contextElement;
     WaitMilliseconds = waitMilliseconds;
 }
Example #4
0
 public PageElement(IWebDriver driver, By contextBy, By targetBy, int waitMilliseconds)
 {
     ThisDriver       = driver;
     TargetBy         = targetBy;
     Context          = new PageElement(driver, contextBy, waitMilliseconds);
     WaitMilliseconds = waitMilliseconds;
 }
Example #5
0
        /// <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");
            }
        }
Example #6
0
        public bool Contains(By childBy)
        {
            var childElement = new PageElement(childBy);

            return(Contains(childElement));
        }