[−][src]Struct webdriver_client::Element
An HTML element within a WebDriver session.
Methods
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]
&self,
selector: &str,
strategy: LocationStrategy
) -> Result<Element, Error>
pub fn find_elements(
&self,
selector: &str,
strategy: LocationStrategy
) -> Result<Vec<Element>, Error>
[src]
&self,
selector: &str,
strategy: LocationStrategy
) -> Result<Vec<Element>, Error>
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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> Typeable for T where
T: Any,
T: Any,