#[non_exhaustive]pub enum Selector {
Ref(usize),
Css(String),
Text(String),
Role {
role: String,
name: Option<String>,
},
}Expand description
How to identify an element on the page.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Ref(usize)
@ref index from the last snapshot() call (e.g. Ref(0) = @e0).
Css(String)
CSS selector string.
Text(String)
Visible text match (finds first button/link/label containing this text).
Role
ARIA role and optional accessible name.
Resolved to a CSS attribute selector like [role="button"][aria-label="Submit"].
When name is None, matches any element with the given role.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Selector
impl RefUnwindSafe for Selector
impl Send for Selector
impl Sync for Selector
impl Unpin for Selector
impl UnsafeUnpin for Selector
impl UnwindSafe for Selector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more