pub struct WebDriver { /* private fields */ }
Expand description
The WebDriver is the primary way by which interaction is managed between the Selenium-Webdriver Server, and our client.
Implementations§
Source§impl WebDriver
impl WebDriver
Sourcepub fn start_session(&mut self) -> Result<()>
pub fn start_session(&mut self) -> Result<()>
Actually starts and creates a session on the server, collecting the session ID on success, and returning an error on failure
Sourcepub fn get_current_url(&self) -> Result<String>
pub fn get_current_url(&self) -> Result<String>
Returns the current url of the browsing context. See examples for more details on how this is used
pub fn get_title(&self) -> Result<String>
Source§impl WebDriver
impl WebDriver
Sourcepub fn query_element(
&self,
selector: Selector,
query: &str,
) -> Result<Element<'_>>
👎Deprecated since 0.1.2: query_element does not follow WebDriver naming convention, use find_element
pub fn query_element( &self, selector: Selector, query: &str, ) -> Result<Element<'_>>
Requests an elements from the webpage, given the specified selector and query string
Sourcepub fn find_element(
&self,
selector: Selector,
query: &str,
) -> Result<Element<'_>>
pub fn find_element( &self, selector: Selector, query: &str, ) -> Result<Element<'_>>
Requests an elements from the webpage, given the specified selector and query string
Source§impl WebDriver
impl WebDriver
Sourcepub fn execute_script<T: DeserializeOwned>(
&self,
script: &str,
args: &[Value],
) -> Result<T>
pub fn execute_script<T: DeserializeOwned>( &self, script: &str, args: &[Value], ) -> Result<T>
Executes the given script synchronously and returns the result
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WebDriver
impl !RefUnwindSafe for WebDriver
impl Send for WebDriver
impl Sync for WebDriver
impl Unpin for WebDriver
impl !UnwindSafe for WebDriver
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more