pub trait WebDriverCompatibleCommand: Debug {
// Required methods
fn endpoint(
&self,
base_url: &Url,
session_id: Option<&str>,
) -> Result<Url, ParseError>;
fn method_and_body(&self, request_url: &Url) -> (Method, Option<String>);
// Provided methods
fn is_new_session(&self) -> bool { ... }
fn is_legacy(&self) -> bool { ... }
}
Expand description
A command that can be sent to the WebDriver.
Anything that implements this command can be sent to Client::issue_cmd()
in order
to send custom commands to the WebDriver instance.
Required Methods§
Provided Methods§
Sourcefn is_new_session(&self) -> bool
fn is_new_session(&self) -> bool
Return true if this command starts a new WebDriver session.
Sourcefn is_legacy(&self) -> bool
fn is_legacy(&self) -> bool
Return true if this session should only support the legacy webdriver protocol.
This only applies to the obsolete JSON Wire Protocol and should return false
for all implementations that follow the W3C specification.
See https://www.selenium.dev/documentation/legacy/json_wire_protocol/ for more details about JSON Wire Protocol.
Implementations on Foreign Types§
Source§impl WebDriverCompatibleCommand for WebDriverCommand<VoidWebDriverExtensionCommand>
impl WebDriverCompatibleCommand for WebDriverCommand<VoidWebDriverExtensionCommand>
Source§fn endpoint(
&self,
base_url: &Url,
session_id: Option<&str>,
) -> Result<Url, ParseError>
fn endpoint( &self, base_url: &Url, session_id: Option<&str>, ) -> Result<Url, ParseError>
Helper for determining what URL endpoint to use for various requests.
This mapping is essentially that of https://www.w3.org/TR/webdriver/#list-of-endpoints.
fn method_and_body(&self, request_url: &Url) -> (Method, Option<String>)
fn is_new_session(&self) -> bool
fn is_legacy(&self) -> bool
Source§impl<T> WebDriverCompatibleCommand for &Twhere
T: WebDriverCompatibleCommand,
Blanket implementation for &T, for better ergonomics.
impl<T> WebDriverCompatibleCommand for &Twhere
T: WebDriverCompatibleCommand,
Blanket implementation for &T, for better ergonomics.
Source§impl<T> WebDriverCompatibleCommand for Box<T>where
T: WebDriverCompatibleCommand,
Blanket implementation for Box, for better ergonomics.
impl<T> WebDriverCompatibleCommand for Box<T>where
T: WebDriverCompatibleCommand,
Blanket implementation for Box