Skip to contents

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.

Usage

is_enabled(x)

is_disabled(x)

Arguments

x

A selenider_element object.

Value

A boolean value: TRUE or FALSE.

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

Examples

html <- "
<button></button>
<button disabled></button>
"

session <- minimal_selenider_session(html)

is_enabled(s("button")) # TRUE

is_disabled(ss("button")[[2]]) # TRUE