[][src]Struct thirtyfour::GenericWebDriver

pub struct GenericWebDriver<T: RemoteConnectionAsync + RemoteConnectionAsyncCreate> {
    pub session_id: SessionId,
    // some fields omitted
}

NOTE: For WebDriver method documentation, see the WebDriverCommands trait.

The thirtyfour crate uses a generic struct that implements the WebDriverCommands trait. The generic struct is then implemented for a specific HTTP client. This enables thirtyfour to support different HTTP clients in order to target different async runtimes. If you do not require a specific async runtime or if you are using tokio then the default will work fine.

The GenericWebDriver struct encapsulates an async Selenium WebDriver browser session. For the sync driver, see sync::GenericWebDriver.

Example:

use thirtyfour::prelude::*;
use thirtyfour::support::block_on;

fn main() -> WebDriverResult<()> {
    block_on(async {
        let caps = DesiredCapabilities::chrome();
        let driver = WebDriver::new("http://localhost:4444/wd/hub", &caps).await?;
        driver.get("http://webappdemo").await?;
        Ok(())
    })
}

Fields

session_id: SessionId

Implementations

impl<T: 'static> GenericWebDriver<T> where
    T: RemoteConnectionAsync + RemoteConnectionAsyncCreate
[src]

pub async fn new<'_, C>(
    remote_server_addr: &'_ str,
    capabilities: C
) -> WebDriverResult<Self> where
    C: Serialize
[src]

The GenericWebDriver struct is not intended to be created directly.

Instead you would use the WebDriver struct, which wires up the GenericWebDriver with a HTTP client for making requests to the WebDriver server.

Create a new WebDriver as follows:

Example

let caps = DesiredCapabilities::chrome();
let driver = WebDriver::new("http://localhost:4444/wd/hub", &caps).await?;

pub fn capabilities(&self) -> DesiredCapabilities[src]

Return a clone of the capabilities as returned by Selenium.

pub async fn quit(__arg0: Self) -> WebDriverResult<()>[src]

End the webdriver session.

Trait Implementations

impl<T: Debug + RemoteConnectionAsync + RemoteConnectionAsyncCreate> Debug for GenericWebDriver<T>[src]

impl<T> Drop for GenericWebDriver<T> where
    T: RemoteConnectionAsync + RemoteConnectionAsyncCreate
[src]

fn drop(&mut self)[src]

Close the current session when the WebDriver struct goes out of scope.

impl<T> WebDriverCommands for GenericWebDriver<T> where
    T: RemoteConnectionAsync + RemoteConnectionAsyncCreate
[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for GenericWebDriver<T>

impl<T> Send for GenericWebDriver<T>

impl<T> Sync for GenericWebDriver<T>

impl<T> Unpin for GenericWebDriver<T> where
    T: Unpin

impl<T> !UnwindSafe for GenericWebDriver<T>

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.