pub struct Chromedriver { /* private fields */ }Expand description
A wrapper struct for a spawned chromedriver process. Keep this alive until your test is complete.
Automatically terminates the spawned chromedriver process when dropped.
You can always manually call terminate, but the on-drop automation makes it much safer in
quickly panicking contexts, such as tests.
Implementations§
Source§impl Chromedriver
impl Chromedriver
Sourcepub async fn run(
version: VersionRequest,
port: PortRequest,
) -> Result<Chromedriver>
pub async fn run( version: VersionRequest, port: PortRequest, ) -> Result<Chromedriver>
Resolve, download, and launch a chromedriver process.
§Errors
Returns an error if the runtime is not multithreaded, version resolution fails, the download fails, or the chromedriver process cannot be spawned.
Sourcepub async fn run_latest_stable() -> Result<Chromedriver>
pub async fn run_latest_stable() -> Result<Chromedriver>
Sourcepub async fn run_latest_beta() -> Result<Chromedriver>
pub async fn run_latest_beta() -> Result<Chromedriver>
Sourcepub async fn run_latest_dev() -> Result<Chromedriver>
pub async fn run_latest_dev() -> Result<Chromedriver>
Sourcepub async fn run_latest_canary() -> Result<Chromedriver>
pub async fn run_latest_canary() -> Result<Chromedriver>
Sourcepub async fn terminate(self) -> Result<ExitStatus, TerminationError>
pub async fn terminate(self) -> Result<ExitStatus, TerminationError>
Gracefully terminate the chromedriver process with default timeouts (3s each).
§Errors
Returns an error if the process cannot be terminated within the timeout.
Sourcepub async fn terminate_with_timeouts(
self,
interrupt_timeout: Duration,
terminate_timeout: Duration,
) -> Result<ExitStatus, TerminationError>
pub async fn terminate_with_timeouts( self, interrupt_timeout: Duration, terminate_timeout: Duration, ) -> Result<ExitStatus, TerminationError>
Gracefully terminate the chromedriver process with custom timeouts.
§Errors
Returns an error if the process cannot be terminated within the given timeouts.