Struct fantoccini::Element
source · pub struct Element { /* private fields */ }
Expand description
A single element on the current page.
Implementations
sourceimpl Element
impl Element
sourcepub fn attr(
&mut self,
attribute: &str
) -> impl Future<Item = Option<String>, Error = CmdError>
pub fn attr(
&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.
sourcepub fn prop(
&mut self,
prop: &str
) -> impl Future<Item = Option<String>, Error = CmdError>
pub fn prop(
&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.
sourcepub fn text(&mut self) -> impl Future<Item = String, Error = CmdError>
pub fn text(&mut self) -> impl Future<Item = String, Error = CmdError>
Retrieve the text contents of this elment.
sourcepub fn html(
&mut self,
inner: bool
) -> impl Future<Item = String, Error = CmdError>
pub fn html(
&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.
sourcepub fn click(self) -> impl Future<Item = Client, Error = CmdError>
pub fn click(self) -> impl Future<Item = Client, Error = CmdError>
Simulate the user clicking on this element.
Note that since this may result in navigation, we give up the handle to the element.
sourcepub fn send_keys(
&mut self,
text: &str
) -> impl Future<Item = (), Error = CmdError>
pub fn send_keys(
&mut self,
text: &str
) -> impl Future<Item = (), Error = CmdError>
Simulate the user sending keys to an element.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Element
impl Send for Element
impl Sync for Element
impl Unpin for Element
impl !UnwindSafe for Element
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more