webdriver.support.expected_conditions

Module Contents

Classes

title_is(self,title) An expectation for checking the title of a page.
title_contains(self,title) An expectation for checking that the title contains a case-sensitive
presence_of_element_located(self,locator) An expectation for checking that an element is present on the DOM
url_contains(self,url) An expectation for checking that the current url contains a
url_matches(self,pattern) An expectation for checking the current url.
url_to_be(self,url) An expectation for checking the current url.
url_changes(self,url) An expectation for checking the current url.
visibility_of_element_located(self,locator) An expectation for checking that an element is present on the DOM of a
visibility_of(self,element) An expectation for checking that an element, known to be present on the
presence_of_all_elements_located(self,locator) An expectation for checking that there is at least one element present
visibility_of_any_elements_located(self,locator) An expectation for checking that there is at least one element visible
visibility_of_all_elements_located(self,locator) An expectation for checking that all elements are present on the DOM of a
text_to_be_present_in_element(self,locator,text_) An expectation for checking if the given text is present in the
text_to_be_present_in_element_value(self,locator,text_) An expectation for checking if the given text is present in the element’s
frame_to_be_available_and_switch_to_it(self,locator) An expectation for checking whether the given frame is available to
invisibility_of_element_located(self,locator) An Expectation for checking that an element is either invisible or not
element_to_be_clickable(self,locator) An Expectation for checking an element is visible and enabled such that
staleness_of(self,element) Wait until an element is no longer attached to the DOM.
element_to_be_selected(self,element) An expectation for checking the selection is selected.
element_located_to_be_selected(self,locator) An expectation for the element to be located is selected.
element_selection_state_to_be(self,element,is_selected) An expectation for checking if the given element is selected.
element_located_selection_state_to_be(self,locator,is_selected) An expectation to locate an element and check if the selection state
number_of_windows_to_be(self,num_windows) An expectation for the number of windows to be a certain value.
new_window_is_opened(self,current_handles) An expectation that a new window will be opened and have the number of
alert_is_present(self) Expect an alert to be present.

Functions

_element_if_visible(element,visibility=True)
_find_element(driver,by) Looks up an element. Logs and re-raises WebDriverException
_find_elements(driver,by)
class title_is(title)

An expectation for checking the title of a page. title is the expected title, which must be an exact match returns True if the title matches, false otherwise.

__init__(title)
__call__(driver)
class title_contains(title)

An expectation for checking that the title contains a case-sensitive substring. title is the fragment of title expected returns True when the title matches, False otherwise

__init__(title)
__call__(driver)
class presence_of_element_located(locator)

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. locator - used to find the element returns the WebElement once it is located

__init__(locator)
__call__(driver)
class url_contains(url)

An expectation for checking that the current url contains a case-sensitive substring. url is the fragment of url expected, returns True when the title matches, False otherwise

__init__(url)
__call__(driver)
class url_matches(pattern)

An expectation for checking the current url. pattern is the expected pattern, which must be an exact match returns True if the title matches, false otherwise.

__init__(pattern)
__call__(driver)
class url_to_be(url)

An expectation for checking the current url. url is the expected url, which must be an exact match returns True if the title matches, false otherwise.

__init__(url)
__call__(driver)
class url_changes(url)

An expectation for checking the current url. url is the expected url, which must not be an exact match returns True if the url is different, false otherwise.

__init__(url)
__call__(driver)
class visibility_of_element_located(locator)

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. locator - used to find the element returns the WebElement once it is located and visible

__init__(locator)
__call__(driver)
class visibility_of(element)

An expectation for checking that an element, known to be present on the DOM of a page, is visible. Visibility means that the element is not only displayed but also has a height and width that is greater than 0. element is the WebElement returns the (same) WebElement once it is visible

__init__(element)
__call__(ignored)
_element_if_visible(element, visibility=True)
class presence_of_all_elements_located(locator)

An expectation for checking that there is at least one element present on a web page. locator is used to find the element returns the list of WebElements once they are located

__init__(locator)
__call__(driver)
class visibility_of_any_elements_located(locator)

An expectation for checking that there is at least one element visible on a web page. locator is used to find the element returns the list of WebElements once they are located

__init__(locator)
__call__(driver)
class visibility_of_all_elements_located(locator)

An expectation for checking that all elements are present on the DOM of a page and visible. Visibility means that the elements are not only displayed but also has a height and width that is greater than 0. locator - used to find the elements returns the list of WebElements once they are located and visible

__init__(locator)
__call__(driver)
class text_to_be_present_in_element(locator, text_)

An expectation for checking if the given text is present in the specified element. locator, text

__init__(locator, text_)
__call__(driver)
class text_to_be_present_in_element_value(locator, text_)

An expectation for checking if the given text is present in the element’s locator, text

__init__(locator, text_)
__call__(driver)
class frame_to_be_available_and_switch_to_it(locator)

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.

__init__(locator)
__call__(driver)
class invisibility_of_element_located(locator)

An Expectation for checking that an element is either invisible or not present on the DOM.

locator used to find the element

__init__(locator)
__call__(driver)
class element_to_be_clickable(locator)

An Expectation for checking an element is visible and enabled such that you can click it.

__init__(locator)
__call__(driver)
class staleness_of(element)

Wait until an element is no longer attached to the DOM. element is the element to wait for. returns False if the element is still attached to the DOM, true otherwise.

__init__(element)
__call__(ignored)
class element_to_be_selected(element)

An expectation for checking the selection is selected. element is WebElement object

__init__(element)
__call__(ignored)
class element_located_to_be_selected(locator)

An expectation for the element to be located is selected. locator is a tuple of (by, path)

__init__(locator)
__call__(driver)
class element_selection_state_to_be(element, is_selected)

An expectation for checking if the given element is selected. element is WebElement object is_selected is a Boolean.”

__init__(element, is_selected)
__call__(ignored)
class element_located_selection_state_to_be(locator, is_selected)

An expectation to locate an element and check if the selection state specified is in that state. locator is a tuple of (by, path) is_selected is a boolean

__init__(locator, is_selected)
__call__(driver)
class number_of_windows_to_be(num_windows)

An expectation for the number of windows to be a certain value.

__init__(num_windows)
__call__(driver)
class new_window_is_opened(current_handles)

An expectation that a new window will be opened and have the number of windows handles increase

__init__(current_handles)
__call__(driver)
class alert_is_present

Expect an alert to be present.

__init__()
__call__(driver)
_find_element(driver, by)

Looks up an element. Logs and re-raises WebDriverException if thrown.

_find_elements(driver, by)