예제 #1
0
        public override IList <IWebElement> Find(IWebElement container)
        {
            By locator = LocatorTransformer.GetNativeLocator(Locator);
            IList <OpenQA.Selenium.IWebElement> nativeElements = container == null
                ? Driver.FindElements(locator)
                : container.FindElements(locator);

            return(nativeElements);
        }
예제 #2
0
        /// <summary>
        /// Wait for element to be displayed
        /// </summary>
        public static void WaitForDisplayed(this HtmlElement element)
        {
            WebDriverWait wait = new WebDriverWait(DriverService.Driver, TimeSpan.FromSeconds(15));

            wait.IgnoreExceptionTypes(typeof(ElementNotVisibleException), typeof(NoSuchElementException));
            wait.Until(ExpectedConditions.ElementIsVisible(
                           LocatorTransformer.GetNativeLocators(element.SearchConfig.FindBy)));
            wait.PollingInterval = TimeSpan.FromSeconds(2);
        }
예제 #3
0
        /// <summary>
        /// Delete the first selected chips from input
        /// </summary>
        public void DeleteFirstChips()
        {
            var chipsFound = NativeElement.FindElements(
                LocatorTransformer.GetNativeLocators(
                    new FindByAttribute(Method.XPath, "../..//li[@title!='']"))).FirstOrDefault();

            new HtmlButton(chipsFound.FindElement(By.XPath(".//span"))).Click();
            NativeElement.Click();
        }