is_visible {selenider}R Documentation

Is an element visible?

Description

is_visible() and is_displayed() checks that an element can be seen on the page, while is_invisible() and is_hidden() checks the opposite. All functions throw an error if the element is not in the DOM.

Usage

is_visible(x)

is_displayed(x)

is_hidden(x)

is_invisible(x)

Arguments

x

A selenider_element object.

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.

Value

A boolean value: TRUE or FALSE.

See Also

Other conditions: has_attr(), has_css_property(), has_length(), has_name(), has_text(), is_enabled(), is_present()

Examples


html <- "
<div style='visibility:hidden;'>Content 1</div>
<div style='display:none'>Content 2</div>
<div>Content 3</div>
"

session <- minimal_selenider_session(html)

is_visible(s("div")) # FALSE

is_invisible(ss("div")[[2]]) # TRUE

is_visible(ss("div")[[3]]) # TRUE


[Package selenider version 0.4.0 Index]