I've got Tests written using Selenium/Java. There is an element with an id="xyz". I need to wait for the above element to disappear, so I am using invisibilityOf()
WebDriverWait wait = new WebDriverWait(driver, 20);
wait.until(ExpectedConditions.invisibilityOfElementLocated(By.id("xyz)));
driver.findElement(By.id("abc)).click(); //error, element xyz intercepted click
The Element just doesn't disappear. Are there any other preferred ways of waitting for an Element to disappear. I tried using JavascriptExecutor, but that would mean implementing JSExecutor for every interaction on the webpage. The big Problem is that the result is flakky, sometimes it works and sometimes not with the above code.