[−][src]Struct fantoccini::Element
A single element on the current page.
Methods
impl Element
[src]
pub fn attr(
&mut self,
attribute: &str
) -> impl Future<Item = Option<String>, Error = CmdError>
[src]
&mut self,
attribute: &str
) -> impl Future<Item = Option<String>, Error = CmdError>
Look up an attribute value for this element by name.
Ok(None)
is returned if the element does not have the given attribute.
pub fn prop(
&mut self,
prop: &str
) -> impl Future<Item = Option<String>, Error = CmdError>
[src]
&mut self,
prop: &str
) -> impl Future<Item = Option<String>, Error = CmdError>
Look up a DOM property for this element by name.
Ok(None)
is returned if the element does not have the given property.
pub fn text(&mut self) -> impl Future<Item = String, Error = CmdError>
[src]
Retrieve the text contents of this elment.
pub fn html(
&mut self,
inner: bool
) -> impl Future<Item = String, Error = CmdError>
[src]
&mut self,
inner: bool
) -> impl Future<Item = String, Error = CmdError>
Retrieve the HTML contents of this element.
inner
dictates whether the wrapping node's HTML is excluded or not. For example, take the
HTML:
<div id="foo"><hr /></div>
With inner = true
, <hr />
would be returned. With inner = false
,
<div id="foo"><hr /></div>
would be returned instead.
pub fn click(self) -> impl Future<Item = Client, Error = CmdError>
[src]
Simulate the user clicking on this element.
Note that since this may result in navigation, we give up the handle to the element.
pub fn send_keys(
&mut self,
text: &str
) -> impl Future<Item = (), Error = CmdError>
[src]
&mut self,
text: &str
) -> impl Future<Item = (), Error = CmdError>
Simulate the user sending keys to an element.
pub fn client(self) -> Client
[src]
Get back the Client
hosting this Element
.
pub fn follow(self) -> impl Future<Item = Client, Error = CmdError>
[src]
Follow the href
target of the element matching the given CSS selector without causing a
click interaction.
Note that since this may result in navigation, we give up the handle to the element.
pub fn select_by_value(
self,
value: &str
) -> impl Future<Item = Client, Error = CmdError>
[src]
self,
value: &str
) -> impl Future<Item = Client, Error = CmdError>
Find and click an option
child element by its value
attribute.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto 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.