pub struct FrameElementLocator<'a> { /* private fields */ }Expand description
A locator for elements within a frame.
This combines a FrameLocator with an element Selector to locate
elements inside an iframe.
Implementations§
Source§impl<'a> FrameElementLocator<'a>
impl<'a> FrameElementLocator<'a>
Sourcepub fn locator(&self, selector: impl Into<String>) -> FrameElementLocator<'a>
pub fn locator(&self, selector: impl Into<String>) -> FrameElementLocator<'a>
Create a child locator that further filters elements.
Sourcepub fn first(&self) -> FrameElementLocator<'a>
pub fn first(&self) -> FrameElementLocator<'a>
Select the first matching element.
Sourcepub fn last(&self) -> FrameElementLocator<'a>
pub fn last(&self) -> FrameElementLocator<'a>
Select the last matching element.
Sourcepub fn nth(&self, index: i32) -> FrameElementLocator<'a>
pub fn nth(&self, index: i32) -> FrameElementLocator<'a>
Select the nth matching element (0-indexed).
Sourcepub fn frame_locator(&self) -> &FrameLocator<'a>
pub fn frame_locator(&self) -> &FrameLocator<'a>
Get the frame locator.
Source§impl FrameElementLocator<'_>
impl FrameElementLocator<'_>
Sourcepub async fn click(&self) -> Result<(), LocatorError>
pub async fn click(&self) -> Result<(), LocatorError>
Click the element within the frame.
Waits for the element to be visible and enabled, then clicks its center.
§Errors
Returns an error if the frame or element is not found, not visible, or the click fails.
Sourcepub async fn fill(&self, text: &str) -> Result<(), LocatorError>
pub async fn fill(&self, text: &str) -> Result<(), LocatorError>
Fill the element with text (clears existing content first).
§Errors
Returns an error if the element cannot be focused or text cannot be inserted.
Sourcepub async fn type_text(&self, text: &str) -> Result<(), LocatorError>
pub async fn type_text(&self, text: &str) -> Result<(), LocatorError>
Type text character by character.
§Errors
Returns an error if the element cannot be focused or keys cannot be dispatched.
Sourcepub async fn hover(&self) -> Result<(), LocatorError>
pub async fn hover(&self) -> Result<(), LocatorError>
Hover over the element.
§Errors
Returns an error if the element cannot be found or the mouse event fails.
Sourcepub async fn text_content(&self) -> Result<Option<String>, LocatorError>
pub async fn text_content(&self) -> Result<Option<String>, LocatorError>
Sourcepub async fn is_visible(&self) -> Result<bool, LocatorError>
pub async fn is_visible(&self) -> Result<bool, LocatorError>
Trait Implementations§
Source§impl<'a> Clone for FrameElementLocator<'a>
impl<'a> Clone for FrameElementLocator<'a>
Source§fn clone(&self) -> FrameElementLocator<'a>
fn clone(&self) -> FrameElementLocator<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more