I am using selenium web driver and I need to wait until all loaders disappear. I have 12 widgets on dashboard page and I need to wait until all widgets are loaded. Loader shows on each widget. I have used both following ways but nothing works and no errors, it just passes on to next statement.
new WebDriverWait(driver,60)
.until(ExpectedConditions.invisibilityOfElementLocated(By.xpath("//div[contains(text(),'Loader')]")));
WebDriverWait wait2 = new WebDriverWait(driver,60);
wait2.until(ExpectedConditions.invisibilityOfElementLocated(By.cssSelector("div.loader")));
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…