is_present()
and is_in_dom()
checks if an element is present on the page,
while is_missing()
and is_absent()
checks the opposite.
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_enabled()
,
is_visible()
Examples
html <- "
<p class='class1'></p>
"
session <- minimal_selenider_session(html)
is_present(s(".class1")) # TRUE
is_in_dom(s(".class2")) # FALSE
is_absent(s(".class2")) # TRUE