pub struct FrameLocator { /* private fields */ }Expand description
A locator scoped to a same-origin <iframe>’s content document.
Build one with Page::frame_locator or
nest with FrameLocator::frame_locator.
Implementations§
Source§impl FrameLocator
impl FrameLocator
Sourcepub fn frame_selector(&self) -> &str
pub fn frame_selector(&self) -> &str
The (outermost) iframe-scoping selector.
Sourcepub fn locator(&self, selector: impl Into<String>) -> Locator
pub fn locator(&self, selector: impl Into<String>) -> Locator
Find an element inside the iframe matching selector.
The returned Locator is scoped to the
iframe’s contentDocument.
pub fn get_by_text(&self, text: &str, exact: bool) -> Locator
pub fn get_by_label(&self, text: &str) -> Locator
pub fn get_by_placeholder(&self, text: &str) -> Locator
pub fn get_by_alt_text(&self, text: &str) -> Locator
pub fn get_by_title(&self, text: &str) -> Locator
pub fn get_by_test_id(&self, test_id: &str) -> Locator
pub fn get_by_role( &self, role: AriaRole, opts: Option<GetByRoleOptions>, ) -> Locator
Sourcepub fn first(&self) -> FrameLocator
pub fn first(&self) -> FrameLocator
Resolve to the first matching iframe (same semantics as Playwright’s
FrameLocator.first, which selects among multiple iframe matches).
Sourcepub fn last(&self) -> FrameLocator
pub fn last(&self) -> FrameLocator
Resolve to the last matching iframe.
Sourcepub fn nth(&self, _index: i32) -> FrameLocator
pub fn nth(&self, _index: i32) -> FrameLocator
Resolve to the iframe at index.
Sourcepub fn frame_locator(&self, selector: impl Into<String>) -> FrameLocator
pub fn frame_locator(&self, selector: impl Into<String>) -> FrameLocator
Find a nested same-origin iframe inside this iframe and return a
FrameLocator scoped to its contentDocument.
Same-origin only (see the module docs). The inner iframe selector is
resolved within the outer iframe’s contentDocument.
Trait Implementations§
Source§impl Clone for FrameLocator
impl Clone for FrameLocator
Source§fn clone(&self) -> FrameLocator
fn clone(&self) -> FrameLocator
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for FrameLocator
impl !UnwindSafe for FrameLocator
impl Freeze for FrameLocator
impl Send for FrameLocator
impl Sync for FrameLocator
impl Unpin for FrameLocator
impl UnsafeUnpin for FrameLocator
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