The methods you've listed are part of the ExpectedConditions
class in Selenium's WebDriverWait
mechanism. They are used for creating various conditions for waiting until certain elements or page states are met before proceeding further in test automation scripts.
Here's a breakdown of the return types for each method:
alertIsPresent()
- Return Type:
Alert
- Description: Waits until an alert box is present and returns a reference to it.
- Return Type:
elementSelectionStateToBe(WebElement element, boolean selected)
- Return Type:
Boolean
- Description: Waits until the selection state of a given element is the specified state (
selected
ornot selected
).
- Return Type:
elementToBeClickable(By locator)
- Return Type:
WebElement
- Description: Waits until the element is visible and enabled such that it is clickable.
- Return Type:
elementToBeSelected(By locator)
- Return Type:
Boolean
- Description: Waits until the specified element is selected.
- Return Type:
frameToBeAvailableAndSwitchToIt(By locator)
- Return Type:
WebDriver
- Description: Waits until the frame is available and then switches the WebDriver's context to it.
- Return Type:
invisibilityOfTheElementLocated(By locator)
- Return Type:
Boolean
- Description: Waits until the specified element is no longer visible.
- Return Type:
invisibilityOfElementWithText(By locator, String text)
- Return Type:
Boolean
- Description: Waits until the specified element is invisible or does not contain the given text.
- Return Type:
presenceOfAllElementsLocatedBy(By locator)
- Return Type:
List<WebElement>
- Description: Waits until all elements matching the given locator are present in the DOM.
- Return Type:
presenceOfElementLocated(By locator)
- Return Type:
WebElement
- Description: Waits until at least one element matching the given locator is present in the DOM.
- Return Type:
textToBePresentInElement(WebElement element, String text)
- Return Type:
Boolean
- Description: Waits until the given text is present in the specified element.
- Return Type:
textToBePresentInElementLocated(By locator, String text)
- Return Type:
Boolean
- Description: Waits until the specified text is present in the element located by the given locator.
- Return Type:
textToBePresentInElementValue(By locator, String text)
- Return Type:
Boolean
- Description: Waits until the specified text is present in the element's value attribute.
- Return Type:
titleIs(String title)
- Return Type:
Boolean
- Description: Waits until the page title matches the given title.
- Return Type:
titleContains(String title)
- Return Type:
Boolean
- Description: Waits until the page title contains the given text.
- Return Type:
visibilityOf(WebElement element)
- Return Type:
WebElement
- Description: Waits until the specified element is visible.
- Return Type:
visibilityOfAllElements(List<WebElement> elements)
- Return Type:
List<WebElement>
- Description: Waits until all elements in the given list are visible.
- Return Type:
visibilityOfAllElementsLocatedBy(By locator)
- Return Type:
List<WebElement>
- Description: Waits until all elements matching the given locator are visible.
- Return Type:
visibilityOfElementLocated(By locator)
- Return Type:
WebElement
- Description: Waits until the element located by the given locator is visible.
- Return Type: