Esempio n. 1
0
        public static void SetValueToMultiselectDropdown(this IWebDriver driver, IWebElement dropdown, string value)
        {
            var itemXpath  = $"//ul[not(@id)]//li[text()=\"{value}\"]";
            var itemsXpath = $"//li[text()=\"{value}\"]//parent::ul[not(@id)]//li";

            dropdown.SendKeys(value);
            CustomWaits.WaitForDropdownFilterApplied(driver, dropdown, itemXpath, itemsXpath);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            IWebDriver  driver  = null;
            IWebElement element = null;

            driver.JavaScriptClick(element);

            driver.SetImplicitWait(10);

            WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(5));

            wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementToBeClickable(element));

            CustomWaits.WaitForElementIsClickable(driver, element, 3);
        }
Esempio n. 3
0
        private static void ClickWebElement(this IWebDriver driver, ReadOnlyCollection <IWebElement> webItems, int delay)
        {
            foreach (var item in webItems)
            {
                try
                {
                    CustomWaits.WaitForElementIsClickable(driver, item, delay);
                    item.Click();

                    break;
                }
                catch (WebDriverTimeoutException)
                {
                }
            }
        }