[−][src]Struct fantoccini::Form
An HTML form on the current page.
Methods
impl Form
[src]
pub async fn set<'_, '_, '_>(
&'_ mut self,
locator: Locator<'_>,
value: &'_ str
) -> Result<Self, CmdError>
[src]
&'_ mut self,
locator: Locator<'_>,
value: &'_ str
) -> Result<Self, CmdError>
Find a form input using the given locator
and set its value to value
.
pub async fn set_by_name<'_, '_, '_>(
&'_ mut self,
field: &'_ str,
value: &'_ str
) -> Result<Self, CmdError>
[src]
&'_ mut self,
field: &'_ str,
value: &'_ str
) -> Result<Self, CmdError>
Find a form input with the given name
and set its value to value
.
pub async fn submit(self) -> Result<Client, CmdError>
[src]
Submit this form using the first available submit button.
false
is returned if no submit button was not found.
pub async fn submit_with<'_>(
__arg0: Self,
button: Locator<'_>
) -> Result<Client, CmdError>
[src]
__arg0: Self,
button: Locator<'_>
) -> Result<Client, CmdError>
Submit this form using the button matched by the given selector.
false
is returned if a matching button was not found.
pub async fn submit_using<'_>(
self,
button_label: &'_ str
) -> Result<Client, CmdError>
[src]
self,
button_label: &'_ str
) -> Result<Client, CmdError>
Submit this form using the form submit button with the given label (case-insensitive).
false
is returned if a matching button was not found.
pub async fn submit_direct(__arg0: Self) -> Result<Client, CmdError>
[src]
Submit this form directly, without clicking any buttons.
This can be useful to bypass forms that perform various magic when the submit button is clicked, or that hijack click events altogether (yes, I'm looking at you online advertisement code).
Note that since no button is actually clicked, the name=value
pair for the submit button
will not be submitted. This can be circumvented by using submit_sneaky
instead.
pub async fn submit_sneaky<'_, '_>(
__arg0: Self,
field: &'_ str,
value: &'_ str
) -> Result<Client, CmdError>
[src]
__arg0: Self,
field: &'_ str,
value: &'_ str
) -> Result<Client, CmdError>
Submit this form directly, without clicking any buttons, and with an extra field.
Like submit_direct
, this method will submit this form without clicking a submit button.
However, it will also inject a hidden input element on the page that carries the given
field=value
mapping. This allows you to emulate the form data as it would have been if
the submit button was indeed clicked.
pub fn client(self) -> Client
[src]
Get back the Client
hosting this Form
.
Trait Implementations
Auto Trait Implementations
impl Send for Form
impl Unpin for Form
impl Sync for Form
impl !UnwindSafe for Form
impl !RefUnwindSafe for Form
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<T> Same<T> for T
type Output = T
Should always be Self