I'm trying to click a button from a modal dialog, but when it's the time to click on it, i have the next error:
OpenQA.Selenium.ElementClickInterceptedException : element click intercepted: Element <button onclick="Activar(193);" class="button mx-1" title="Recover">...</button> is not clickable at point (1206, 319). Other element would receive the click: <div class="ui-widget-overlay" style="width: 1349px; height: 613px; z-index: 1001;"></div>
I know that i need to use a wait helper, but i don't know exactly how to use it, this is my code with the wait helper:
public ConfigurationUsuario HabilitarConfiguracion()
{
WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(20));
iconoActivar.Click();
driver.SwitchTo().ActiveElement();
wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementToBeClickable(By.XPath("//button[@title='Recover']"))).Click();
driver.FindElement(By.XPath("//button[@title='Recover']")).Click();
return new ConfigurationUsuario(driver);
}
Probably it's because i don't know how use wait helper, but the test don't wait the 20 secods, after 2-3 seconds in the modal dialog, it closes, so if anyone can help me, i would really apreciate it