is_disabled() checks that an element has the disabled attribute set to
TRUE, while is_enabled() checks that it does not. Both functions throw an
error if the element does not exist in the DOM.
Details
These functions do not implement a retry mechanism, and only test a condition
once. Use elem_expect() or elem_wait_until() to use these conditions in
tests.
See also
Other conditions:
has_attr(),
has_css_property(),
has_length(),
has_name(),
has_text(),
is_present(),
is_visible()
Examples
html <- "
<button></button>
<button disabled></button>
"
session <- minimal_selenider_session(html)
is_enabled(s("button")) # TRUE
is_disabled(ss("button")[[2]]) # TRUE