pub struct ChromeCapabilities { /* private fields */ }
Expand description

Capabilities for Chrome.

Implementations§

source§

impl ChromeCapabilities

source

pub fn new() -> Self

Create a new ChromeCapabilities struct.

Trait Implementations§

source§

impl BrowserCapabilitiesHelper for ChromeCapabilities

source§

const KEY: &'static str = "goog:chromeOptions"

The key containing the browser-specific capabilities.
source§

fn insert_browser_option( &mut self, key: impl Into<String>, value: impl Serialize ) -> WebDriverResult<()>

Add any Serialize-able object to the capabilities under the browser’s custom key.
source§

fn remove_browser_option(&mut self, key: &str)

Remove the custom browser-specific property, if it exists.
source§

fn browser_option<T>(&self, key: &str) -> Option<T>

Get the custom browser-specific property, if it exists.
source§

impl CapabilitiesHelper for ChromeCapabilities

source§

fn _get(&self, key: &str) -> Option<&Value>

Get an immutable reference to the underlying serde_json::Value.
source§

fn _get_mut(&mut self, key: &str) -> Option<&mut Value>

Get a mutable reference to the underlying serde_json::Value.
source§

fn insert_base_capability(&mut self, key: String, value: Value)

Set the specified capability at the root level.
source§

fn set_base_capability<T>(&mut self, key: &str, value: T) -> WebDriverResult<()>
where T: Serialize,

Add any Serialize-able object to the capabilities under the specified key.
source§

fn set_version(&mut self, version: &str) -> WebDriverResult<()>

Set the desired browser version.
source§

fn set_platform(&mut self, platform: &str) -> WebDriverResult<()>

Set the desired browser platform.
source§

fn set_javascript_enabled(&mut self, enabled: bool) -> WebDriverResult<()>

Set whether the session supports executing user-supplied Javascript.
source§

fn set_database_enabled(&mut self, enabled: bool) -> WebDriverResult<()>

Set whether the session can interact with database storage.
source§

fn set_location_context_enabled(&mut self, enabled: bool) -> WebDriverResult<()>

Set whether the session can set and query the browser’s location context.
source§

fn set_application_cache_enabled( &mut self, enabled: bool ) -> WebDriverResult<()>

Set whether the session can interact with the application cache.
source§

fn set_browser_connection_enabled( &mut self, enabled: bool ) -> WebDriverResult<()>

Set whether the session can query for the browser’s connectivity and disable it if desired.
source§

fn set_web_storage_enabled(&mut self, enabled: bool) -> WebDriverResult<()>

Set whether the session supports interactions with local storage.
source§

fn accept_ssl_certs(&mut self, enabled: bool) -> WebDriverResult<()>

👎Deprecated since 0.32.0-rc.5: please use accept_insecure_certs instead
Set whether the session should accept all SSL certificates by default.
source§

fn accept_insecure_certs(&mut self, enabled: bool) -> WebDriverResult<()>

Set whether the session should accept insecure SSL certificates by default.
source§

fn set_rotatable(&mut self, enabled: bool) -> WebDriverResult<()>

Set whether the session can rotate the current page’s layout between portrait and landscape orientations. Only applies to mobile platforms.
source§

fn set_native_events(&mut self, enabled: bool) -> WebDriverResult<()>

Set whether the session is capable of generating native events when simulating user input.
source§

fn set_proxy(&mut self, proxy: Proxy) -> WebDriverResult<()>

Set the proxy to use.
source§

fn set_unexpected_alert_behaviour( &mut self, behaviour: AlertBehaviour ) -> WebDriverResult<()>

Set the behaviour to be followed when an unexpected alert is encountered.
source§

fn set_element_scroll_behaviour( &mut self, behaviour: ScrollBehaviour ) -> WebDriverResult<()>

Set whether elements are scrolled into the viewport for interation to align with the top or the bottom of the viewport. The default is to align with the top.
source§

fn handles_alerts(&self) -> Option<bool>

Get whether the session can interact with modal popups such as window.alert.
source§

fn css_selectors_enabled(&self) -> Option<bool>

Get whether the session supports CSS selectors when searching for elements.
source§

fn page_load_strategy(&self) -> WebDriverResult<PageLoadStrategy>

Get the current page load strategy.
source§

fn set_page_load_strategy( &mut self, strategy: PageLoadStrategy ) -> WebDriverResult<()>

Set the page load strategy to use.
source§

impl ChromiumLikeCapabilities for ChromeCapabilities

source§

fn args(&self) -> Vec<String>

Get the current list of command-line arguments to chromedriver as a vec.
source§

fn extensions(&self) -> Vec<String>

Get the current list of Chrome extensions as a vec. Read more
source§

fn binary(&self) -> Option<String>

Get the path to the chrome binary (if one was previously set).
source§

fn set_binary(&mut self, path: &str) -> WebDriverResult<()>

Set the path to chrome binary to use.
source§

fn unset_binary(&mut self)

Unset the chrome binary path.
source§

fn debugger_address(&self) -> Option<String>

Get the current debugger address (if one was previously set).
source§

fn set_debugger_address(&mut self, address: &str) -> WebDriverResult<()>

Set the debugger address.
source§

fn unset_debugger_address(&mut self)

Unset the debugger address.
source§

fn add_arg(&mut self, arg: &str) -> WebDriverResult<()>

Add the specified command-line argument to chromedriver. Read more
source§

fn remove_arg(&mut self, arg: &str) -> WebDriverResult<()>

Remove the specified Chrome command-line argument if it had been added previously.
source§

fn has_arg(&self, arg: &str) -> bool

Return true if the specified arg is currently set.
source§

fn add_experimental_option( &mut self, name: impl Into<String>, value: impl Serialize ) -> WebDriverResult<()>

Add the specified experimental option. Read more
source§

fn remove_experimental_option(&mut self, name: &str)

Remove the specified experimental option.
source§

fn add_encoded_extension( &mut self, extension_base64: &str ) -> WebDriverResult<()>

Add a base64-encoded extension.
source§

fn remove_encoded_extension( &mut self, extension_base64: &str ) -> WebDriverResult<()>

Remove the specified base64-encoded extension if it had been added previously.
source§

fn add_extension(&mut self, crx_file: &Path) -> WebDriverResult<()>

Add Chrome extension file. This will be a file with a .CRX extension.
source§

fn remove_extension(&mut self, crx_file: &Path) -> WebDriverResult<()>

Remove the specified Chrome extension file if an identical extension had been added previously.
source§

fn exclude_switches(&self) -> Vec<String>

Get the list of exclude switches.
source§

fn add_exclude_switch(&mut self, arg: &str) -> WebDriverResult<()>

Add the specified arg to the list of exclude switches.
source§

fn remove_exclude_switch(&mut self, arg: &str) -> WebDriverResult<()>

Remove the specified arg from the list of exclude switches.
source§

fn set_headless(&mut self) -> WebDriverResult<()>

Set the –headless option.
source§

fn unset_headless(&mut self) -> WebDriverResult<()>

Unset the –headless option.
source§

fn is_headless(&mut self) -> bool

Return true if the –headless option is set.
source§

fn set_disable_web_security(&mut self) -> WebDriverResult<()>

Set the –disable-web-security option.
source§

fn unset_disable_web_security(&mut self) -> WebDriverResult<()>

Unset the –disable-web-security option.
source§

fn is_disable_web_security(&mut self) -> bool

Return true if the –disable-web-security option is set.
source§

fn set_ignore_certificate_errors(&mut self) -> WebDriverResult<()>

Set the –ignore-certificate-errors option.
source§

fn unset_ignore_certificate_errors(&mut self) -> WebDriverResult<()>

Unset the –ignore-certificate-errors option.
source§

fn is_ignore_certificate_errors(&mut self) -> bool

Return true if the –ignore-certificate-errors option is set.
source§

fn set_no_sandbox(&mut self) -> WebDriverResult<()>

Set the –no-sandbox option.
source§

fn unset_no_sandbox(&mut self) -> WebDriverResult<()>

Unset the –no-sandbox option.
source§

fn is_no_sandbox(&mut self) -> bool

Return true if the –no-sandbox option is set.
source§

fn set_disable_gpu(&mut self) -> WebDriverResult<()>

Set the –disable-gpu option.
source§

fn unset_disable_gpu(&mut self) -> WebDriverResult<()>

Unset the –disable-gpu option.
source§

fn is_disable_gpu(&mut self) -> bool

Return true if the –disable-gpu option is set.
source§

fn set_disable_dev_shm_usage(&mut self) -> WebDriverResult<()>

Set the –disable-dev-shm-usage option.
source§

fn unset_disable_dev_shm_usage(&mut self) -> WebDriverResult<()>

Unset the –disable-dev-shm-usage option.
source§

fn is_disable_dev_shm_usage(&mut self) -> bool

Return true if the –disable-dev-shm-usage option is set.
source§

fn set_disable_local_storage(&mut self) -> WebDriverResult<()>

Set the –disable-local-storage option.
source§

fn unset_disable_local_storage(&mut self) -> WebDriverResult<()>

Unset the –disable-local-storage option.
source§

fn is_disable_local_storage(&mut self) -> bool

Return true if the –disable-local-storage option is set.
source§

impl Clone for ChromeCapabilities

source§

fn clone(&self) -> ChromeCapabilities

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ChromeCapabilities

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ChromeCapabilities

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl From<ChromeCapabilities> for Capabilities

source§

fn from(caps: ChromeCapabilities) -> Capabilities

Converts to this type from the input type.
source§

impl Serialize for ChromeCapabilities

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more