[−][src]Struct thirtyfour::WebDriver
The WebDriver struct encapsulates an async Selenium WebDriver browser session. For the sync driver, see sync::WebDriver.
See the WebDriverCommands trait for WebDriver methods.
Example:
use thirtyfour::prelude::*; use tokio; #[tokio::main] async fn main() -> WebDriverResult<()> { 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
Methods
impl WebDriver
[src]
pub async fn new<'_, T>(
remote_server_addr: &'_ str,
capabilities: T
) -> WebDriverResult<Self> where
T: Serialize,
[src]
remote_server_addr: &'_ str,
capabilities: T
) -> WebDriverResult<Self> where
T: Serialize,
Create a new async WebDriver struct.
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.
Trait Implementations
impl Debug for WebDriver
[src]
impl Drop for WebDriver
[src]
impl WebDriverCommands for WebDriver
[src]
fn cmd<'life0, 'life1, 'async_trait>(
&'life0 self,
command: Command<'life1>
) -> Pin<Box<dyn Future<Output = WebDriverResult<Value>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
command: Command<'life1>
) -> Pin<Box<dyn Future<Output = WebDriverResult<Value>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn session(&self) -> WebDriverSession
[src]
#[must_use]fn close<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn quit<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn get<'life0, 'async_trait, S: Into<String> + Send>(
&'life0 self,
url: S
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
S: 'async_trait,
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self,
url: S
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
S: 'async_trait,
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn current_url<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<String>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<String>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn page_source<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<String>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<String>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn title<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<String>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<String>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn find_element<'b, 'life0, 'async_trait>(
&'b self,
by: By<'life0>
) -> Pin<Box<dyn Future<Output = WebDriverResult<WebElement<'b>>> + Send + 'async_trait>> where
'b: 'async_trait,
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'b self,
by: By<'life0>
) -> Pin<Box<dyn Future<Output = WebDriverResult<WebElement<'b>>> + Send + 'async_trait>> where
'b: 'async_trait,
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn find_elements<'b, 'life0, 'async_trait>(
&'b self,
by: By<'life0>
) -> Pin<Box<dyn Future<Output = WebDriverResult<Vec<WebElement<'b>>>> + Send + 'async_trait>> where
'b: 'async_trait,
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'b self,
by: By<'life0>
) -> Pin<Box<dyn Future<Output = WebDriverResult<Vec<WebElement<'b>>>> + Send + 'async_trait>> where
'b: 'async_trait,
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn execute_script<'b, 'life0, 'async_trait>(
&'b self,
script: &'life0 str
) -> Pin<Box<dyn Future<Output = WebDriverResult<ScriptRet<'b>>> + Send + 'async_trait>> where
'b: 'async_trait,
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'b self,
script: &'life0 str
) -> Pin<Box<dyn Future<Output = WebDriverResult<ScriptRet<'b>>> + Send + 'async_trait>> where
'b: 'async_trait,
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn execute_script_with_args<'b, 'life0, 'life1, 'async_trait>(
&'b self,
script: &'life0 str,
args: &'life1 ScriptArgs
) -> Pin<Box<dyn Future<Output = WebDriverResult<ScriptRet<'b>>> + Send + 'async_trait>> where
'b: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'b self,
script: &'life0 str,
args: &'life1 ScriptArgs
) -> Pin<Box<dyn Future<Output = WebDriverResult<ScriptRet<'b>>> + Send + 'async_trait>> where
'b: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn execute_async_script<'b, 'life0, 'async_trait>(
&'b self,
script: &'life0 str
) -> Pin<Box<dyn Future<Output = WebDriverResult<ScriptRet<'b>>> + Send + 'async_trait>> where
'b: 'async_trait,
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'b self,
script: &'life0 str
) -> Pin<Box<dyn Future<Output = WebDriverResult<ScriptRet<'b>>> + Send + 'async_trait>> where
'b: 'async_trait,
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn execute_async_script_with_args<'b, 'life0, 'life1, 'async_trait>(
&'b self,
script: &'life0 str,
args: &'life1 ScriptArgs
) -> Pin<Box<dyn Future<Output = WebDriverResult<ScriptRet<'b>>> + Send + 'async_trait>> where
'b: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'b self,
script: &'life0 str,
args: &'life1 ScriptArgs
) -> Pin<Box<dyn Future<Output = WebDriverResult<ScriptRet<'b>>> + Send + 'async_trait>> where
'b: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn current_window_handle<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<WindowHandle>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<WindowHandle>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn window_handles<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<Vec<WindowHandle>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<Vec<WindowHandle>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn maximize_window<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn minimize_window<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn fullscreen_window<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn get_window_rect<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<Rect>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<Rect>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn set_window_rect<'life0, 'async_trait>(
&'life0 self,
rect: OptionRect
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self,
rect: OptionRect
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn back<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn forward<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn refresh<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn get_timeouts<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<TimeoutConfiguration>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<TimeoutConfiguration>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn set_timeouts<'life0, 'async_trait>(
&'life0 self,
timeouts: TimeoutConfiguration
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self,
timeouts: TimeoutConfiguration
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn implicitly_wait<'life0, 'async_trait>(
&'life0 self,
time_to_wait: Duration
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self,
time_to_wait: Duration
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn set_script_timeout<'life0, 'async_trait>(
&'life0 self,
time_to_wait: Duration
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self,
time_to_wait: Duration
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn set_page_load_timeout<'life0, 'async_trait>(
&'life0 self,
time_to_wait: Duration
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self,
time_to_wait: Duration
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn action_chain(&self) -> ActionChain
[src]
#[must_use]fn get_cookies<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<Vec<Cookie>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<Vec<Cookie>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn get_cookie<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = WebDriverResult<Cookie>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = WebDriverResult<Cookie>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn delete_cookie<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn delete_all_cookies<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn add_cookie<'life0, 'async_trait>(
&'life0 self,
cookie: Cookie
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self,
cookie: Cookie
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn screenshot_as_base64<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<String>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<String>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn screenshot_as_png<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<Vec<u8>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = WebDriverResult<Vec<u8>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn screenshot<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self,
path: &'life1 Path
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
fn switch_to(&self) -> SwitchTo
[src]
#[must_use]fn set_window_name<'life0, 'life1, 'async_trait>(
&'life0 self,
window_name: &'life1 str
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
[src]
&'life0 self,
window_name: &'life1 str
) -> Pin<Box<dyn Future<Output = WebDriverResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
Auto Trait Implementations
impl !RefUnwindSafe for WebDriver
impl Send for WebDriver
impl Sync for WebDriver
impl Unpin for WebDriver
impl !UnwindSafe for WebDriver
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>,