pub struct BrowserConfig {
pub webdriver_url: String,
pub browser: BrowserType,
pub headless: bool,
pub viewport_width: u32,
pub viewport_height: u32,
pub page_load_timeout_secs: u64,
pub script_timeout_secs: u64,
pub implicit_wait_secs: u64,
pub user_agent: Option<String>,
pub browser_args: Vec<String>,
}Available on crate feature
browser only.Expand description
Configuration for browser sessions.
Fields§
§webdriver_url: StringWebDriver server URL (e.g., “http://localhost:4444”)
browser: BrowserTypeBrowser type to use
headless: boolRun in headless mode (no visible window)
viewport_width: u32Viewport width in pixels
viewport_height: u32Viewport height in pixels
page_load_timeout_secs: u64Page load timeout in seconds
script_timeout_secs: u64Script execution timeout in seconds
implicit_wait_secs: u64Implicit wait timeout in seconds
user_agent: Option<String>User agent string override
browser_args: Vec<String>Additional browser arguments
Implementations§
Source§impl BrowserConfig
impl BrowserConfig
Sourcepub fn new() -> BrowserConfig
pub fn new() -> BrowserConfig
Create a new config with default values.
Sourcepub fn webdriver_url(self, url: impl Into<String>) -> BrowserConfig
pub fn webdriver_url(self, url: impl Into<String>) -> BrowserConfig
Set the WebDriver URL.
Sourcepub fn browser(self, browser: BrowserType) -> BrowserConfig
pub fn browser(self, browser: BrowserType) -> BrowserConfig
Set the browser type.
Sourcepub fn headless(self, headless: bool) -> BrowserConfig
pub fn headless(self, headless: bool) -> BrowserConfig
Enable or disable headless mode.
Sourcepub fn viewport(self, width: u32, height: u32) -> BrowserConfig
pub fn viewport(self, width: u32, height: u32) -> BrowserConfig
Set the viewport size.
Sourcepub fn page_load_timeout(self, secs: u64) -> BrowserConfig
pub fn page_load_timeout(self, secs: u64) -> BrowserConfig
Set page load timeout.
Sourcepub fn user_agent(self, ua: impl Into<String>) -> BrowserConfig
pub fn user_agent(self, ua: impl Into<String>) -> BrowserConfig
Set a custom user agent.
Sourcepub fn add_arg(self, arg: impl Into<String>) -> BrowserConfig
pub fn add_arg(self, arg: impl Into<String>) -> BrowserConfig
Add a browser argument.
Sourcepub fn observable(self) -> BrowserConfig
pub fn observable(self) -> BrowserConfig
Configure for observable mode (noVNC-compatible).
Sets headless: false and viewport to 1280x720 for noVNC viewing.
Use this when running with Selenium’s noVNC viewer (port 7900).
Trait Implementations§
Source§impl Clone for BrowserConfig
impl Clone for BrowserConfig
Source§fn clone(&self) -> BrowserConfig
fn clone(&self) -> BrowserConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BrowserConfig
impl Debug for BrowserConfig
Source§impl Default for BrowserConfig
impl Default for BrowserConfig
Source§fn default() -> BrowserConfig
fn default() -> BrowserConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for BrowserConfig
impl<'de> Deserialize<'de> for BrowserConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<BrowserConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<BrowserConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for BrowserConfig
impl Serialize for BrowserConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for BrowserConfig
impl RefUnwindSafe for BrowserConfig
impl Send for BrowserConfig
impl Sync for BrowserConfig
impl Unpin for BrowserConfig
impl UnsafeUnpin for BrowserConfig
impl UnwindSafe for BrowserConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestCreates a shared type from an unshared type.