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:

  1. There is one active session at most.
  2. 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>,

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.

source

pub fn is_ready(&self) -> Result<(), WdcError>

source

pub fn navi_to(&self, url: &str) -> Result<&Self, WdcError>

source

pub fn get_url(&self) -> Result<Vec<u8>, WdcError>

source

pub fn find_elem_css(&self, v: &str) -> Result<Vec<u8>, WdcError>

source

pub fn find_elems_css(&self, v: &str) -> Result<Vec<String>, WdcError>

source

pub fn elem_send_keys(&self, eleid: &str, keys: &str) -> Result<(), WdcError>

source

pub fn screenshot(&self, save_path: &str) -> Result<(), WdcError>

source

pub fn screenshot_elem( &self, eleid: &str, save_path: &str ) -> Result<(), WdcError>

source

pub fn print_page(&self, save_path: &str) -> Result<(), WdcError>

source

pub fn page_src( &self, save_path: Option<&str> ) -> Result<Option<Vec<u8>>, WdcError>

source

pub fn exec_sync( &self, script: &str, args: Vec<&str> ) -> Result<Vec<u8>, WdcError>

source

pub fn exec_async( &self, script: &str, args: Vec<&str> ) -> Result<Vec<u8>, WdcError>

source

pub fn perform_actions(&self, actg: ActionGroup<'_>) -> Result<(), WdcError>

source

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,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<D> Default for WebDrvClient<D>where D: CreateWebDrvClient + for<'de, 'c1, 'c2> CreateW3cSession<'de, 'c1, 'c2> + Default,

source§

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>,

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.