elem_submit {selenider} | R Documentation |
Submit an element
Description
If an element is an ancestor of a form, submits the form.
Works by walking up the DOM, checking each ancestor element until
the element is a <form>
element, which it then submits. If such
an element does not exist, an error is thrown.
Usage
elem_submit(x, js = FALSE, timeout = NULL)
Arguments
x |
A |
js |
Whether to submit the form using JavaScript. |
timeout |
How long to wait for the element to exist. |
Value
x
, invisibly.
See Also
Other actions:
elem_click()
,
elem_hover()
,
elem_scroll_to()
,
elem_select()
,
elem_set_value()
Examples
html <- "
<form>
<input type='submit'>
<p>Random text</p>
</form>
<a>Random link</a>
"
session <- minimal_selenider_session(html)
elem_submit(s("input"))
elem_submit(s("p"))
# Won't work since the element doesn't have a form ancestor
try(elem_submit(s("a"), timeout = 0.5))
[Package selenider version 0.4.0 Index]