Struct wdc::WebDrvClient
source · pub struct WebDrvClient<D>where
D: CreateWebDrvClient + for<'de, 'c1, 'c2> CreateW3cSession<'de, 'c1, 'c2>,{ /* private fields */ }
Expand description
The client-side implementation of WebDriver.
It serves as the basic client implementation, with several assumptions:
- There is one active session at most.
- The session is standard-compliant.
See module-level docs crate
for the usage.
Implementations§
source§impl<D> WebDrvClient<D>where
D: CreateWebDrvClient + for<'de, 'c1, 'c2> CreateW3cSession<'de, 'c1, 'c2>,
impl<D> WebDrvClient<D>where D: CreateWebDrvClient + for<'de, 'c1, 'c2> CreateW3cSession<'de, 'c1, 'c2>,
The identical implementations shared by any standard-compliance WebDriver
client, regardless of driver type D
.
WebDriver clients speak “commands”, which form a large part of the client implementation. W3C standard defines a minimal set of commands that every standard-compliance server and client should support. Here is a one-to-one(roughly) map for that set.
pub fn is_ready(&self) -> Result<(), WdcError>
pub fn get_url(&self) -> Result<Vec<u8>, WdcError>
pub fn find_elem_css(&self, v: &str) -> Result<Vec<u8>, WdcError>
pub fn find_elems_css(&self, v: &str) -> Result<Vec<String>, WdcError>
pub fn elem_send_keys(&self, eleid: &str, keys: &str) -> Result<(), WdcError>
pub fn screenshot(&self, save_path: &str) -> Result<(), WdcError>
pub fn screenshot_elem( &self, eleid: &str, save_path: &str ) -> Result<(), WdcError>
pub fn print_page(&self, save_path: &str) -> Result<(), WdcError>
pub fn page_src( &self, save_path: Option<&str> ) -> Result<Option<Vec<u8>>, WdcError>
pub fn exec_sync( &self, script: &str, args: Vec<&str> ) -> Result<Vec<u8>, WdcError>
pub fn exec_async( &self, script: &str, args: Vec<&str> ) -> Result<Vec<u8>, WdcError>
pub fn perform_actions(&self, actg: ActionGroup<'_>) -> Result<(), WdcError>
pub fn last_session_meta(&self) -> Result<&SessionMeta, WdcError>
Trait Implementations§
source§impl<D> Debug for WebDrvClient<D>where
D: CreateWebDrvClient + for<'de, 'c1, 'c2> CreateW3cSession<'de, 'c1, 'c2> + Debug,
impl<D> Debug for WebDrvClient<D>where D: CreateWebDrvClient + for<'de, 'c1, 'c2> CreateW3cSession<'de, 'c1, 'c2> + Debug,
source§impl<D> Default for WebDrvClient<D>where
D: CreateWebDrvClient + for<'de, 'c1, 'c2> CreateW3cSession<'de, 'c1, 'c2> + Default,
impl<D> Default for WebDrvClient<D>where D: CreateWebDrvClient + for<'de, 'c1, 'c2> CreateW3cSession<'de, 'c1, 'c2> + Default,
source§fn default() -> WebDrvClient<D>
fn default() -> WebDrvClient<D>
Returns the “default value” for a type. Read more
source§impl<D> Drop for WebDrvClient<D>where
D: CreateWebDrvClient + for<'de, 'c1, 'c2> CreateW3cSession<'de, 'c1, 'c2>,
impl<D> Drop for WebDrvClient<D>where D: CreateWebDrvClient + for<'de, 'c1, 'c2> CreateW3cSession<'de, 'c1, 'c2>,
Auto Trait Implementations§
impl<D> RefUnwindSafe for WebDrvClient<D>where D: RefUnwindSafe,
impl<D> Send for WebDrvClient<D>where D: Send,
impl<D> Sync for WebDrvClient<D>where D: Sync,
impl<D> Unpin for WebDrvClient<D>where D: Unpin,
impl<D> UnwindSafe for WebDrvClient<D>where D: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more