ExpectedConditions ClassWebDriver
Supplies a set of common conditions that can be waited for using WebDriverWait.
Inheritance Hierarchy

SystemObject
  OpenQA.Selenium.Support.UIExpectedConditions

Namespace: OpenQA.Selenium.Support.UI
Assembly: WebDriver.Support (in WebDriver.Support.dll) Version: 3.1.0
Syntax

public sealed class ExpectedConditions

The ExpectedConditions type exposes the following members.

Methods

  NameDescription
Public methodStatic memberAlertIsPresent
An expectation for checking the AlterIsPresent
Public methodStatic memberAlertState
An expectation for checking the Alert State
Public methodStatic memberElementExists
An expectation for checking that an element is present on the DOM of a page. This does not necessarily mean that the element is visible.
Public methodStatic memberElementIsVisible
An expectation for checking that an element is present on the DOM of a page and visible. Visibility means that the element is not only displayed but also has a height and width that is greater than 0.
Public methodStatic memberElementSelectionStateToBe(By, Boolean)
An expectation for checking if the given element is in correct state.
Public methodStatic memberElementSelectionStateToBe(IWebElement, Boolean)
An expectation for checking if the given element is in correct state.
Public methodStatic memberElementToBeClickable(By)
An expectation for checking an element is visible and enabled such that you can click it.
Public methodStatic memberElementToBeClickable(IWebElement)
An expectation for checking an element is visible and enabled such that you can click it.
Public methodStatic memberElementToBeSelected(By)
An expectation for checking if the given element is selected.
Public methodStatic memberElementToBeSelected(IWebElement)
An expectation for checking if the given element is selected.
Public methodStatic memberElementToBeSelected(IWebElement, Boolean)
An expectation for checking if the given element is selected.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodStatic memberFrameToBeAvailableAndSwitchToIt(String)
An expectation for checking whether the given frame is available to switch to. If the frame is available it switches the given driver to the specified frame.
Public methodStatic memberFrameToBeAvailableAndSwitchToIt(By)
An expectation for checking whether the given frame is available to switch to. If the frame is available it switches the given driver to the specified frame.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodStatic memberInvisibilityOfElementLocated
An expectation for checking that an element is either invisible or not present on the DOM.
Public methodStatic memberInvisibilityOfElementWithText
An expectation for checking that an element with text is either invisible or not present on the DOM.
Public methodStatic memberPresenceOfAllElementsLocatedBy
An expectation for checking that all elements present on the web page that match the locator.
Public methodStatic memberStalenessOf
Wait until an element is no longer attached to the DOM.
Public methodStatic memberTextToBePresentInElement
An expectation for checking if the given text is present in the specified element.
Public methodStatic memberTextToBePresentInElementLocated
An expectation for checking if the given text is present in the element that matches the given locator.
Public methodStatic memberTextToBePresentInElementValue(By, String)
An expectation for checking if the given text is present in the specified elements value attribute.
Public methodStatic memberTextToBePresentInElementValue(IWebElement, String)
An expectation for checking if the given text is present in the specified elements value attribute.
Public methodStatic memberTitleContains
An expectation for checking that the title of a page contains a case-sensitive substring.
Public methodStatic memberTitleIs
An expectation for checking the title of a page.
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)
Public methodStatic memberUrlContains
An expectation for the URL of the current page to be a specific URL.
Public methodStatic memberUrlMatches
An expectation for the URL of the current page to be a specific URL.
Public methodStatic memberUrlToBe
An expectation for the URL of the current page to be a specific URL.
Public methodStatic memberVisibilityOfAllElementsLocatedBy(By)
An expectation for checking that all elements present on the web page that match the locator are visible. Visibility means that the elements are not only displayed but also have a height and width that is greater than 0.
Public methodStatic memberVisibilityOfAllElementsLocatedBy(ReadOnlyCollectionIWebElement)
An expectation for checking that all elements present on the web page that match the locator are visible. Visibility means that the elements are not only displayed but also have a height and width that is greater than 0.
Top
Examples

IWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(3))
IWebElement element = wait.Until(ExpectedConditions.ElementExists(By.Id("foo")));
See Also

Reference