[−][src]Struct fantoccini::Element
A single element on the current page.
Methods
impl Element
[src]
pub async fn attr<'_, '_>(
&'_ mut self,
attribute: &'_ str
) -> Result<Option<String>, CmdError>
[src]
&'_ mut self,
attribute: &'_ str
) -> Result<Option<String>, 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 async fn prop<'_, '_>(
&'_ mut self,
prop: &'_ str
) -> Result<Option<String>, CmdError>
[src]
&'_ mut self,
prop: &'_ str
) -> Result<Option<String>, 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 async fn text<'_>(&'_ mut self) -> Result<String, CmdError>
[src]
Retrieve the text contents of this elment.
pub async fn html<'_>(&'_ mut self, inner: bool) -> Result<String, CmdError>
[src]
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 async fn find<'_, '_>(
&'_ mut self,
search: Locator<'_>
) -> Result<Element, CmdError>
[src]
&'_ mut self,
search: Locator<'_>
) -> Result<Element, CmdError>
Find the first matching descendant element.
pub async fn find_all<'_, '_>(
&'_ mut self,
search: Locator<'_>
) -> Result<Vec<Element>, CmdError>
[src]
&'_ mut self,
search: Locator<'_>
) -> Result<Vec<Element>, CmdError>
Find all matching descendant elements.
pub async fn click(__arg0: Self) -> Result<Client, 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 async fn clear<'_>(&'_ mut self) -> Result<(), CmdError>
[src]
Clear the value prop of this element
pub async fn send_keys<'_, '_>(
&'_ mut self,
text: &'_ str
) -> Result<(), CmdError>
[src]
&'_ mut self,
text: &'_ str
) -> Result<(), CmdError>
Simulate the user sending keys to an element.
pub fn client(self) -> Client
[src]
Get back the Client
hosting this Element
.
pub async fn follow(__arg0: Self) -> Result<Client, 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 async fn select_by_value<'_>(
__arg0: Self,
value: &'_ str
) -> Result<Client, CmdError>
[src]
__arg0: Self,
value: &'_ str
) -> Result<Client, CmdError>
Find and click an option
child element by its value
attribute.
Trait Implementations
Auto Trait Implementations
impl Send for Element
impl Sync for Element
impl Unpin for Element
impl !UnwindSafe for Element
impl !RefUnwindSafe for Element
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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> 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