[][src]Trait webdriver::capabilities::BrowserCapabilities

pub trait BrowserCapabilities {
    fn init(&mut self, _: &Capabilities);
fn browser_name(
        &mut self,
        _: &Capabilities
    ) -> WebDriverResult<Option<String>>;
fn browser_version(
        &mut self,
        _: &Capabilities
    ) -> WebDriverResult<Option<String>>;
fn compare_browser_version(
        &mut self,
        version: &str,
        comparison: &str
    ) -> WebDriverResult<bool>;
fn platform_name(
        &mut self,
        _: &Capabilities
    ) -> WebDriverResult<Option<String>>;
fn accept_insecure_certs(
        &mut self,
        _: &Capabilities
    ) -> WebDriverResult<bool>;
fn set_window_rect(&mut self, _: &Capabilities) -> WebDriverResult<bool>;
fn strict_file_interactability(
        &mut self,
        _: &Capabilities
    ) -> WebDriverResult<bool>;
fn accept_proxy(
        &mut self,
        proxy_settings: &Map<String, Value>,
        _: &Capabilities
    ) -> WebDriverResult<bool>;
fn validate_custom(&self, name: &str, value: &Value) -> WebDriverResult<()>;
fn accept_custom(
        &mut self,
        name: &str,
        value: &Value,
        merged: &Capabilities
    ) -> WebDriverResult<bool>; }

Trait for objects that can be used to inspect browser capabilities

The main methods in this trait are called with a Capabilites object resulting from a full set of potential capabilites for the session. Given those Capabilities they return a property of the browser instance that would be initiated. In many cases this will be independent of the input, but in the case of e.g. browser version, it might depend on a path to the binary provided as a capability.

Required methods

fn init(&mut self, _: &Capabilities)

Set up the Capabilites object

Typically used to create any internal caches

fn browser_name(&mut self, _: &Capabilities) -> WebDriverResult<Option<String>>

Name of the browser

fn browser_version(
    &mut self,
    _: &Capabilities
) -> WebDriverResult<Option<String>>

Version number of the browser

fn compare_browser_version(
    &mut self,
    version: &str,
    comparison: &str
) -> WebDriverResult<bool>

Compare actual browser version to that provided in a version specifier

Parameters are the actual browser version and the comparison string, respectively. The format of the comparison string is implementation-defined.

fn platform_name(&mut self, _: &Capabilities) -> WebDriverResult<Option<String>>

Name of the platform/OS

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

Whether insecure certificates are supported

fn set_window_rect(&mut self, _: &Capabilities) -> WebDriverResult<bool>

Indicates whether driver supports all of the window resizing and repositioning commands.

fn strict_file_interactability(
    &mut self,
    _: &Capabilities
) -> WebDriverResult<bool>

Indicates that interactability checks will be applied to <input type=file>.

fn accept_proxy(
    &mut self,
    proxy_settings: &Map<String, Value>,
    _: &Capabilities
) -> WebDriverResult<bool>

fn validate_custom(&self, name: &str, value: &Value) -> WebDriverResult<()>

Type check custom properties

Check that custom properties containing ":" have the correct data types. Properties that are unrecognised must be ignored i.e. return without error.

fn accept_custom(
    &mut self,
    name: &str,
    value: &Value,
    merged: &Capabilities
) -> WebDriverResult<bool>

Check if custom properties are accepted capabilites

Check that custom properties containing ":" are compatible with the implementation.

Loading content...

Implementors

Loading content...