[][src]Struct webdriver_client::Element

pub struct Element<'a> { /* fields omitted */ }

An HTML element within a WebDriver session.

Implementations

impl<'a> Element<'a>[src]

pub fn new(s: &'a DriverSession, reference: String) -> Self[src]

pub fn attribute(&self, name: &str) -> Result<String, Error>[src]

pub fn property(&self, name: &str) -> Result<String, Error>[src]

Return this element's property value.

WebDriver spec: https://www.w3.org/TR/webdriver/#get-element-property

pub fn click(&self) -> Result<(), Error>[src]

Click this element.

WebDriver spec: https://www.w3.org/TR/webdriver/#element-click

pub fn clear(&self) -> Result<(), Error>[src]

Clear the text of this element.

WebDriver spec: https://www.w3.org/TR/webdriver/#element-clear

pub fn send_keys(&self, s: &str) -> Result<(), Error>[src]

Send key presses to this element.

WebDriver spec: https://www.w3.org/TR/webdriver/#element-send-keys

pub fn css_value(&self, name: &str) -> Result<String, Error>[src]

pub fn text(&self) -> Result<String, Error>[src]

pub fn name(&self) -> Result<String, Error>[src]

Returns the tag name for this element

pub fn find_element(
    &self,
    selector: &str,
    strategy: LocationStrategy
) -> Result<Element<'_>, Error>
[src]

pub fn find_elements(
    &self,
    selector: &str,
    strategy: LocationStrategy
) -> Result<Vec<Element<'_>>, Error>
[src]

pub fn reference(&self) -> Result<JsonValue, Error>[src]

Returns a reference that can be passed on to the API

pub fn raw_reference(&self) -> &str[src]

The raw reference id that identifies this element, this can be used with Element::new()

pub fn inner_html(&self) -> Result<JsonValue, Error>[src]

Gets the innerHTML javascript attribute for this element. Some drivers can get this using regular attributes, in others it does not work. This method gets it executing a bit of javascript.

pub fn outer_html(&self) -> Result<JsonValue, Error>[src]

pub fn screenshot(&self) -> Result<Screenshot, Error>[src]

Take a screenshot of this element

WebDriver specification: https://www.w3.org/TR/webdriver/#take-element-screenshot

Trait Implementations

impl<'a> Debug for Element<'a>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Element<'a>

impl<'a> !Send for Element<'a>

impl<'a> !Sync for Element<'a>

impl<'a> Unpin for Element<'a>

impl<'a> !UnwindSafe for Element<'a>

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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> Typeable for T where
    T: Any