[][src]Struct webdriver_client::DriverSession

pub struct DriverSession { /* fields omitted */ }

A WebDriver session.

By default the session is removed on Drop

Methods

impl DriverSession[src]

pub fn create_session(
    driver: Box<dyn Driver>,
    params: &NewSessionCmd
) -> Result<DriverSession, Error>
[src]

Create a new session with the driver.

pub fn attach(url: &str, session_id: &str) -> Result<DriverSession, Error>[src]

Use an existing session

pub fn browser_name(&self) -> Option<&str>[src]

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

pub fn drop_session(&mut self, drop: bool)[src]

Whether to remove the session on Drop, the default is true

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

Navigate to the given URL

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

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

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

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

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

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

pub fn get_cookies(&self) -> Result<Vec<Cookie>, Error>[src]

Get all cookies

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

pub fn switch_window(&mut self, handle: &str) -> Result<(), Error>[src]

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

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

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

Dismiss an active dialog, if present.

WebDriver spec: https://www.w3.org/TR/webdriver/#dismiss-alert

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

Accept an active dialog, if present.

WebDriver spec: https://www.w3.org/TR/webdriver/#accept-alert

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

Get the message of an active dialog, if present.

WebDriver spec: https://www.w3.org/TR/webdriver/#get-alert-text

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

Set the text field of a user prompt.

WebDriver spec: https://www.w3.org/TR/webdriver/#send-alert-text

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 execute(&self, script: ExecuteCmd) -> Result<JsonValue, Error>[src]

pub fn execute_async(&self, script: ExecuteCmd) -> Result<JsonValue, Error>[src]

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

Valid values are element references as returned by Element::reference() or null to switch to the top level frame

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

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

Take a screenshot of the current frame.

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

Trait Implementations

impl Drop for DriverSession[src]

Auto Trait Implementations

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