I want to know how to replace popular WebDriverWait with lambda.
It is used for explicitly wait some event.
Code snippet:
(new WebDriverWait(Driver.driver.get(), 10)).until(new ExpectedCondition<Boolean>() {
public Boolean apply(WebDriver d) {
return d.findElement(By.id("DataTables_Table_0_processing")).isDisplayed();
}
});
Or:
(new WebDriverWait(Driver.driver.get(), 10))
.until(ExpectedConditions
.invisibilityOfElementLocated(By.id("DataTables_Table_0_processing")));
How to replace it with lambda expression?