Reputation: 2417
My test needs to wait for server push update to delete a row from a table. How can I tell Selenium to wait until a change to the table DOM has occurred?
Upvotes: 5
Views: 7037
Reputation: 8386
There are two ways:
You can either wait for an element to be present (or not present) using wait.until(ExpectedConditions.presenceOfElementSelectedBy(By.selector()))
You can test if JQuery is finished on the page with ((Boolean)driver.executeScript("return jQuery.active == 0"))
Upvotes: 6