So, I have an element which is hidden under an alert. Alert stays for 10 secs and the user can click the element after that. Here is my code to deal with this situation:
WebElement create = driver.findElement(By.cssSelector("div.action_menu_trigger"));
WebDriverWait wait = new WebDriverWait(driver, 20);
wait.until(ExpectedConditions.elementToBeClickable(create));
create.click();
but I get this exception as soon as WebDriver reaches here, seems like Selenium doesn't care about wait method:
org.openqa.selenium.ElementClickInterceptedException:
Element <div class="action_menu_trigger"> is not clickable at point (1710.224952697754,140) because another element <div class="noty_body"> obscures it
Build info: version: '3.13.0', revision: '2f0d292', time: '2018-06-25T15:24:21.231Z'
I have tried by using Thread.sleep(10000)
and it works fine but I don't want to use sleep.