pub async fn new_with_timeout<C>(
        server_url: &str,
        capabilities: C,
        timeout: Option<Duration>,
    ) -> WebDriverResult<Self>
    where
        C: Serialize,
    {
        let params = HttpClientCreateParams {
            server_url: server_url.to_string(),
            timeout,
        };
        let conn = T::create(params)?;

        let (session_id, session_capabilities) = start_session(&conn, capabilities).await?;

        let driver = GenericWebDriver {
            session: WebDriverSession::new(session_id, Arc::new(Mutex::new(conn))),
            capabilities: session_capabilities,
            phantom: PhantomData,
        };

        Ok(driver)
    }
/// Creates a new GenericWebDriver just like the `new` function. Allows a
/// configurable timeout for all HTTP requests including the session creation.
///
/// Create a new WebDriver as follows:
///
/// # Example
/// ```rust
/// # use thirtyfour::prelude::*;
/// # use thirtyfour::support::block_on;
/// # use std::time::Duration;
/// #
/// # fn main() -> WebDriverResult<()> {
/// #     block_on(async {
/// let caps = DesiredCapabilities::chrome();
/// let driver = WebDriver::new_with_timeout("http://localhost:4444/wd/hub", &caps, Some(Duration::from_secs(120))).await?;
/// #         driver.quit().await?;
/// #         Ok(())
/// #     })
/// # }
/// ```
Creates a new GenericWebDriver just like the `new` function. Allows a
configurable timeout for all HTTP requests including the session creation.

Create a new WebDriver as follows.
Creates a new GenericWebDriver just like the ` new ` function . Allows a configurable timeout for all HTTP requests including the session creation . Create a new WebDriver as follows .
pub async fn new_with_timeout<C>(
        server_url: &str,
        capabilities: C,
        timeout: Option<Duration>,
    ) -> WebDriverResult<Self>
    where
        C: Serialize,
    {
        let params = HttpClientCreateParams {
            server_url: server_url.to_string(),
            timeout,
        };
        let conn = T::create(params)?;
        let (session_id, session_capabilities) = start_session(&conn, capabilities).await?;
        let driver = GenericWebDriver {
            session: WebDriverSession::new(session_id, Arc::new(Mutex::new(conn))),
            capabilities: session_capabilities,
            phantom: PhantomData,
        };
        Ok(driver)
    }
pub async fn new_with_timeout < C > ( server_url : & str , capabilities : C , timeout : Option < Duration > , ) -> WebDriverResult < Self > where C : Serialize , { let params = HttpClientCreateParams { server_url : server_url . to_string ( ) , timeout , } ; let conn = T :: create ( params ) ? ; let ( session_id , session_capabilities ) = start_session ( & conn , capabilities ) . await ? ; let driver = GenericWebDriver { session : WebDriverSession :: new ( session_id , Arc :: new ( Mutex :: new ( conn ) ) ) , capabilities : session_capabilities , phantom : PhantomData , } ; Ok ( driver ) }
Creates a new GenericWebDriver just like the `new` function.
Creates a new GenericWebDriver just like the ` new ` function .
server_url
&str
capabilities
C
timeout
Option<Duration>
server_url
&str
capabilities
C
timeout
Option<Duration>
example
None
use thirtyfour::prelude::*;
None
use thirtyfour::support::block_on;
None
use std::time::duration;
None
fn main() -> webdriverresult<()> {
None
block_on(async {
None
driver.quit().await?;
None
ok(())
None
})
None
}
None