pub struct Driver { /* private fields */ }Expand description
Firefox WebDriver coordinator.
The driver is responsible for:
- Spawning Firefox processes with custom profiles
- Managing WebSocket server lifecycle
- Tracking active browser windows
§Examples
use firefox_webdriver::Driver;
let driver = Driver::builder()
.binary("/usr/bin/firefox")
.extension("./extension")
.build()
.await?;
let window = driver.window().headless().spawn().await?;Implementations§
Source§impl Driver
impl Driver
Sourcepub fn builder() -> DriverBuilder
pub fn builder() -> DriverBuilder
Creates a configuration builder for the driver.
§Example
use firefox_webdriver::Driver;
let driver = Driver::builder()
.binary("/usr/bin/firefox")
.extension("./extension")
.build()
.await?;Sourcepub fn window(&self) -> WindowBuilder<'_>
pub fn window(&self) -> WindowBuilder<'_>
Creates a window builder for spawning new browser windows.
§Example
let window = driver.window()
.headless()
.window_size(1920, 1080)
.spawn()
.await?;Sourcepub fn window_count(&self) -> usize
pub fn window_count(&self) -> usize
Returns the number of active windows currently tracked.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Driver
impl !RefUnwindSafe for Driver
impl Send for Driver
impl Sync for Driver
impl Unpin for Driver
impl !UnwindSafe for Driver
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