What is ExpectedCondition in Selenium Webdriver?

Can someone explain what is ExpectedCondition in Selenium Webdriver?

1 Like

Hey Joe, ExpectedConditions are provided by Selenium Webdriver and are used with Explicit waits to check web elements with given locators. Explicit waits and Expected Conditions are used to verify a page’s title or validity of a URL or to simply identify the web elements. Some of the Expected Condition methods are:

ExpectedCondition < WebElement > elementToBeClickable(By locator)

ExpectedCondition < Boolean > elementToBeSelected(By locator)

ExpectedCondition < WebElement > presenceOfElementLocated(By locator)

ExpectedCondition < Boolean > titleContains(String title)

ExpectedCondition < Boolean > titleIs(String title)

ExpectedCondition < Boolean > urlContains(String fraction)

ExpectedCondition < Boolean > urlToBe(String url)

ExpectedCondition < WebElement > visibilityOfElementLocated(By locator)
1 Like