Capabilities

Trait Capabilities 

Source
pub trait Capabilities {
Show 22 methods // Required methods fn get(&self) -> &Value; fn get_mut(&mut self) -> &mut Value; // Provided methods fn add<T>(&mut self, key: &str, value: T) -> Result<(), WebDriverError> where T: Serialize { ... } fn add_subkey<T>( &mut self, key: &str, subkey: &str, value: T, ) -> Result<(), WebDriverError> where T: Serialize { ... } fn remove_subkey( &mut self, key: &str, subkey: &str, ) -> Result<(), WebDriverError> { ... } fn update(&mut self, value: Value) { ... } fn set_version(&mut self, version: &str) -> Result<(), WebDriverError> { ... } fn set_platform(&mut self, platform: &str) -> Result<(), WebDriverError> { ... } fn set_javascript_enabled( &mut self, enabled: bool, ) -> Result<(), WebDriverError> { ... } fn set_database_enabled( &mut self, enabled: bool, ) -> Result<(), WebDriverError> { ... } fn set_location_context_enabled( &mut self, enabled: bool, ) -> Result<(), WebDriverError> { ... } fn set_application_cache_enabled( &mut self, enabled: bool, ) -> Result<(), WebDriverError> { ... } fn set_browser_connection_enabled( &mut self, enabled: bool, ) -> Result<(), WebDriverError> { ... } fn set_web_storage_enabled( &mut self, enabled: bool, ) -> Result<(), WebDriverError> { ... } fn accept_ssl_certs(&mut self, enabled: bool) -> Result<(), WebDriverError> { ... } fn set_rotatable(&mut self, enabled: bool) -> Result<(), WebDriverError> { ... } fn set_native_events(&mut self, enabled: bool) -> Result<(), WebDriverError> { ... } fn set_proxy(&mut self, proxy: Proxy) -> Result<(), WebDriverError> { ... } fn set_unexpected_alert_behaviour( &mut self, behaviour: AlertBehaviour, ) -> Result<(), WebDriverError> { ... } fn set_element_scroll_behaviour( &mut self, behaviour: ScrollBehaviour, ) -> Result<(), WebDriverError> { ... } fn handles_alerts(&self) -> Option<bool> { ... } fn css_selectors_enabled(&self) -> Option<bool> { ... }
}
Expand description

Re-export common types.

Required Methods§

Source

fn get(&self) -> &Value

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

Source

fn get_mut(&mut self) -> &mut Value

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

Provided Methods§

Source

fn add<T>(&mut self, key: &str, value: T) -> Result<(), WebDriverError>
where T: Serialize,

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

Source

fn add_subkey<T>( &mut self, key: &str, subkey: &str, value: T, ) -> Result<(), WebDriverError>
where T: Serialize,

Add any Serialize-able object to the capabilities under the specified key and subkey.

Source

fn remove_subkey( &mut self, key: &str, subkey: &str, ) -> Result<(), WebDriverError>

Remove a subkey from the specified key, if it exists.

Source

fn update(&mut self, value: Value)

Add all keys of the specified object into the capabilities, overwriting any matching keys that already exist.

Source

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

Set the desired browser version.

Source

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

Set the desired browser platform.

Source

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

Set whether the session supports executing user-supplied Javascript.

Source

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

Set whether the session can interact with database storage.

Source

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

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

Source

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

Set whether the session can interact with the application cache.

Source

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

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, ) -> Result<(), WebDriverError>

Set whether the session supports interactions with local storage.

Source

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

Set whether the session should accept all SSL certificates by default.

Source

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

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) -> Result<(), WebDriverError>

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

Source

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

Set the proxy to use.

Source

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

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

Source

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

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Capabilities for ChromeCapabilities

Source§

impl Capabilities for DesiredCapabilities

Add generic Capabilities implementation. This can be used as a convenient way to interact with the returned capabilities from a WebDriver instance, or as a way to construct a custom capabilities JSON struct.

Source§

impl Capabilities for EdgeCapabilities

Source§

impl Capabilities for FirefoxCapabilities

Source§

impl Capabilities for InternetExplorerCapabilities

Source§

impl Capabilities for OperaCapabilities

Source§

impl Capabilities for SafariCapabilities