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); }
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) { } } }