Skip to main content

QueryExt

Trait QueryExt 

Source
pub trait QueryExt {
    // Required methods
    fn snapshot(
        &self,
    ) -> impl Future<Output = Result<SnapshotResult, BrowserError>> + Send;
    fn screenshot(
        &self,
        path: &str,
    ) -> impl Future<Output = Result<(), BrowserError>> + Send;
    fn pdf(
        &self,
        path: &str,
    ) -> impl Future<Output = Result<(), BrowserError>> + Send;
    fn eval(
        &self,
        script: &str,
    ) -> impl Future<Output = Result<JsonValue, BrowserError>> + Send;
    fn get(
        &self,
        what: &str,
    ) -> impl Future<Output = Result<String, BrowserError>> + Send;
    fn get_attr(
        &self,
        selector: &str,
        attr: &str,
    ) -> impl Future<Output = Result<String, BrowserError>> + Send;
    fn get_count(
        &self,
        selector: &str,
    ) -> impl Future<Output = Result<usize, BrowserError>> + Send;
    fn get_box(
        &self,
        selector: &str,
    ) -> impl Future<Output = Result<BoundingBox, BrowserError>> + Send;
    fn get_styles(
        &self,
        selector: &str,
    ) -> impl Future<Output = Result<HashMap<String, String>, BrowserError>> + Send;
    fn find(
        &self,
        locator_type: &str,
        value: &str,
        action: &str,
        action_value: Option<&str>,
    ) -> impl Future<Output = Result<String, BrowserError>> + Send;
    fn is_(
        &self,
        what: &str,
        selector: &str,
    ) -> impl Future<Output = Result<bool, BrowserError>> + Send;
    fn download(
        &self,
        selector: &str,
        path: &str,
    ) -> impl Future<Output = Result<String, BrowserError>> + Send;
}
Expand description

Query and snapshot operations for browser client

Required Methods§

Source

fn snapshot( &self, ) -> impl Future<Output = Result<SnapshotResult, BrowserError>> + Send

Take an accessibility snapshot of the current page

Source

fn screenshot( &self, path: &str, ) -> impl Future<Output = Result<(), BrowserError>> + Send

Take a screenshot and save to path

Source

fn pdf( &self, path: &str, ) -> impl Future<Output = Result<(), BrowserError>> + Send

Save page as PDF

Source

fn eval( &self, script: &str, ) -> impl Future<Output = Result<JsonValue, BrowserError>> + Send

Evaluate JavaScript in the browser

Source

fn get( &self, what: &str, ) -> impl Future<Output = Result<String, BrowserError>> + Send

Get page content (text, html, value, url, or title)

Source

fn get_attr( &self, selector: &str, attr: &str, ) -> impl Future<Output = Result<String, BrowserError>> + Send

Get element attribute value

Source

fn get_count( &self, selector: &str, ) -> impl Future<Output = Result<usize, BrowserError>> + Send

Get count of elements matching selector

Source

fn get_box( &self, selector: &str, ) -> impl Future<Output = Result<BoundingBox, BrowserError>> + Send

Get element bounding box

Source

fn get_styles( &self, selector: &str, ) -> impl Future<Output = Result<HashMap<String, String>, BrowserError>> + Send

Get element computed styles

Source

fn find( &self, locator_type: &str, value: &str, action: &str, action_value: Option<&str>, ) -> impl Future<Output = Result<String, BrowserError>> + Send

Find elements using various locator strategies

Source

fn is_( &self, what: &str, selector: &str, ) -> impl Future<Output = Result<bool, BrowserError>> + Send

Check element state (visible, hidden, enabled, disabled, editable)

Source

fn download( &self, selector: &str, path: &str, ) -> impl Future<Output = Result<String, BrowserError>> + Send

Download file from link/button to path

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§