Forms
Interactions with form
tag.
Reading the element
Getting the right element class for the xpath
| my_form = web.element('//*[id="myForm"]')
type(my_select)
|
Outputfastrpa.core.elements.FormElement
| my_form = web.button('//*[id="myForm"]')
type(my_select)
|
Outputfastrpa.core.elements.FormElement
Reference
Output'https://www.mysite.com/form'
Output'application/x-www-form-urlencoded'
| my_form.submit('//*[id="formSubmit"]')
|
Success conditions
Forms also accept success conditions to ensure your form was properly filled. If any condition fail, the form raises a FormException
.
Set success by rediret to any url
| my_form.set_success_condition(redirect_url='https:://.../success_page.html')
|
Set success by any element on the page
| my_form.set_success_condition(elements_to_find=['//div[@id="success_message"]'])
|
Set success by any text on the page
| my_form.set_success_condition(text_to_find=['Success!'])
|
Set success by all available conditions
| my_form.set_success_condition(
redirect_url='https:://.../success_page.html',
elements_to_find=['//div[@id="success_message"]'],
text_to_find=['Success!'])
|
OutputTraceback (most recent call last):
...
FormException: The form submission got an error! Condition [redirect_url, https://...] not satisfied!