pub enum Selector {
Show 15 variants
Css(String),
Text {
text: String,
exact: bool,
},
Role {
role: AriaRole,
name: Option<String>,
},
TestId(String),
TestIdCustom {
id: String,
attribute: String,
},
Label(String),
Placeholder(String),
Chained(Box<Selector>, Box<Selector>),
Nth {
base: Box<Selector>,
index: i32,
},
AltText {
text: String,
exact: bool,
},
Title {
text: String,
exact: bool,
},
And(Box<Selector>, Box<Selector>),
Or(Box<Selector>, Box<Selector>),
FilterText {
base: Box<Selector>,
text: String,
exact: bool,
has_not: bool,
},
FilterHas {
base: Box<Selector>,
child: Box<Selector>,
has_not: bool,
},
}Expand description
Selector for finding elements.
Variants§
Css(String)
CSS selector.
Text
Text content selector.
Role
ARIA role selector with optional accessible name.
TestId(String)
Test ID selector (data-testid attribute).
TestIdCustom
Test ID with custom attribute.
Label(String)
Label selector (finds form elements by label text).
Placeholder(String)
Placeholder selector.
Chained(Box<Selector>, Box<Selector>)
Chained selector (parent >> child).
Nth
Nth element in a collection (0-based index, negative from end).
AltText
Alt text selector for images.
Title
Title attribute selector.
And(Box<Selector>, Box<Selector>)
AND combinator - matches elements that match both selectors.
Or(Box<Selector>, Box<Selector>)
OR combinator - matches elements that match either selector.
FilterText
Filter by text content.
FilterHas
Filter by having a child that matches another selector.
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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.