[][src]Struct fantoccini::Form

pub struct Form { /* fields omitted */ }

An HTML form on the current page.

Methods

impl Form[src]

pub fn set(
    &mut self,
    locator: Locator,
    value: &str
) -> impl Future<Item = Self, Error = CmdError>
[src]

Find a form input using the given locator and set its value to value.

pub fn set_by_name<'s>(
    &mut self,
    field: &str,
    value: &str
) -> impl Future<Item = Self, Error = CmdError>
[src]

Find a form input with the given name and set its value to value.

pub fn submit(self) -> impl Future<Item = Client, Error = CmdError>[src]

Submit this form using the first available submit button.

false is returned if no submit button was not found.

pub fn submit_with(
    self,
    button: Locator
) -> impl Future<Item = Client, Error = CmdError>
[src]

Submit this form using the button matched by the given selector.

false is returned if a matching button was not found.

pub fn submit_using(
    self,
    button_label: &str
) -> impl Future<Item = Client, Error = CmdError>
[src]

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 fn submit_direct(self) -> impl Future<Item = Client, Error = 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 fn submit_sneaky(
    self,
    field: &str,
    value: &str
) -> impl Future<Item = Client, Error = CmdError>
[src]

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

impl Clone for Form[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for Form

impl Sync for Form

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Erased for T