States¶
States functions are used to determine whether an element has a state, such as whether it is displayed or selected.
These functions operate on an element, and return a boolean.
is_displayed¶
-
is_displayed
¶
Determines whether an element is displayed to the user.
- Returns
bool
True if displayed, False otherwise.- Examples
>>> browser.get_element(id="not-hiding").is_displayed True >>> browser.get_element(id="hiding").is_displayed False
Note
is_displayed
does not work on hidden select options.