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§
Sourcefn snapshot(
&self,
) -> impl Future<Output = Result<SnapshotResult, BrowserError>> + Send
fn snapshot( &self, ) -> impl Future<Output = Result<SnapshotResult, BrowserError>> + Send
Take an accessibility snapshot of the current page
Sourcefn screenshot(
&self,
path: &str,
) -> impl Future<Output = Result<(), BrowserError>> + Send
fn screenshot( &self, path: &str, ) -> impl Future<Output = Result<(), BrowserError>> + Send
Take a screenshot and save to path
Sourcefn pdf(
&self,
path: &str,
) -> impl Future<Output = Result<(), BrowserError>> + Send
fn pdf( &self, path: &str, ) -> impl Future<Output = Result<(), BrowserError>> + Send
Save page as PDF
Sourcefn eval(
&self,
script: &str,
) -> impl Future<Output = Result<JsonValue, BrowserError>> + Send
fn eval( &self, script: &str, ) -> impl Future<Output = Result<JsonValue, BrowserError>> + Send
Evaluate JavaScript in the browser
Sourcefn get(
&self,
what: &str,
) -> impl Future<Output = Result<String, BrowserError>> + Send
fn get( &self, what: &str, ) -> impl Future<Output = Result<String, BrowserError>> + Send
Get page content (text, html, value, url, or title)
Sourcefn get_attr(
&self,
selector: &str,
attr: &str,
) -> impl Future<Output = Result<String, BrowserError>> + Send
fn get_attr( &self, selector: &str, attr: &str, ) -> impl Future<Output = Result<String, BrowserError>> + Send
Get element attribute value
Sourcefn get_count(
&self,
selector: &str,
) -> impl Future<Output = Result<usize, BrowserError>> + Send
fn get_count( &self, selector: &str, ) -> impl Future<Output = Result<usize, BrowserError>> + Send
Get count of elements matching selector
Sourcefn get_box(
&self,
selector: &str,
) -> impl Future<Output = Result<BoundingBox, BrowserError>> + Send
fn get_box( &self, selector: &str, ) -> impl Future<Output = Result<BoundingBox, BrowserError>> + Send
Get element bounding box
Sourcefn get_styles(
&self,
selector: &str,
) -> impl Future<Output = Result<HashMap<String, String>, BrowserError>> + Send
fn get_styles( &self, selector: &str, ) -> impl Future<Output = Result<HashMap<String, String>, BrowserError>> + Send
Get element computed styles
Sourcefn find(
&self,
locator_type: &str,
value: &str,
action: &str,
action_value: Option<&str>,
) -> impl Future<Output = Result<String, BrowserError>> + Send
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
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.