[−][src]Struct webdriver_client::DriverSession
A WebDriver session.
By default the session is removed on Drop
Methods
impl DriverSession
[src]
pub fn create_session(
driver: Box<dyn Driver>,
params: &NewSessionCmd
) -> Result<DriverSession, Error>
[src]
driver: Box<dyn Driver>,
params: &NewSessionCmd
) -> Result<DriverSession, Error>
Create a new session with the driver.
pub fn attach(url: &str, session_id: &str) -> Result<DriverSession, Error>
[src]
Use an existing session
pub fn browser_name(&self) -> Option<&str>
[src]
pub fn session_id(&self) -> &str
[src]
pub fn drop_session(&mut self, drop: bool)
[src]
Whether to remove the session on Drop, the default is true
pub fn go(&self, url: &str) -> Result<(), Error>
[src]
Navigate to the given URL
pub fn get_current_url(&self) -> Result<String, Error>
[src]
pub fn back(&self) -> Result<(), Error>
[src]
pub fn forward(&self) -> Result<(), Error>
[src]
pub fn refresh(&self) -> Result<(), Error>
[src]
pub fn get_page_source(&self) -> Result<String, Error>
[src]
pub fn get_title(&self) -> Result<String, Error>
[src]
pub fn get_cookies(&self) -> Result<Vec<Cookie>, Error>
[src]
Get all cookies
pub fn get_window_handle(&self) -> Result<String, Error>
[src]
pub fn switch_window(&mut self, handle: &str) -> Result<(), Error>
[src]
pub fn close_window(&mut self) -> Result<(), Error>
[src]
pub fn get_window_handles(&self) -> Result<Vec<String>, Error>
[src]
pub fn dismiss_alert(&self) -> Result<(), Error>
[src]
Dismiss an active dialog, if present.
WebDriver spec: https://www.w3.org/TR/webdriver/#dismiss-alert
pub fn accept_alert(&self) -> Result<(), Error>
[src]
Accept an active dialog, if present.
WebDriver spec: https://www.w3.org/TR/webdriver/#accept-alert
pub fn get_alert_text(&self) -> Result<String, Error>
[src]
Get the message of an active dialog, if present.
WebDriver spec: https://www.w3.org/TR/webdriver/#get-alert-text
pub fn send_alert_text(&self, text: &str) -> Result<(), Error>
[src]
Set the text field of a user prompt.
WebDriver spec: https://www.w3.org/TR/webdriver/#send-alert-text
pub fn find_element(
&self,
selector: &str,
strategy: LocationStrategy
) -> Result<Element, Error>
[src]
&self,
selector: &str,
strategy: LocationStrategy
) -> Result<Element, Error>
pub fn find_elements(
&self,
selector: &str,
strategy: LocationStrategy
) -> Result<Vec<Element>, Error>
[src]
&self,
selector: &str,
strategy: LocationStrategy
) -> Result<Vec<Element>, Error>
pub fn execute(&self, script: ExecuteCmd) -> Result<JsonValue, Error>
[src]
pub fn execute_async(&self, script: ExecuteCmd) -> Result<JsonValue, Error>
[src]
pub fn switch_to_frame(&self, handle: JsonValue) -> Result<(), Error>
[src]
Valid values are element references as returned by Element::reference() or null to switch to the top level frame
pub fn switch_to_parent_frame(&self) -> Result<(), Error>
[src]
pub fn screenshot(&self) -> Result<Screenshot, Error>
[src]
Take a screenshot of the current frame.
WebDriver specification: https://www.w3.org/TR/webdriver/#take-screenshot
Trait Implementations
impl Drop for DriverSession
[src]
Auto Trait Implementations
impl !RefUnwindSafe for DriverSession
impl !Send for DriverSession
impl !Sync for DriverSession
impl Unpin for DriverSession
impl !UnwindSafe for DriverSession
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Typeable for T where
T: Any,
T: Any,