pub struct ClickBuilder<'l, 'a> { /* private fields */ }Expand description
Builder for click operations with configurable options.
Created via Locator::click.
§Example
// Simple click - await directly
page.locator("button").click().await.ok();
// Force click without waiting for actionability
page.locator("button").click().force(true).await.ok();Implementations§
Source§impl<'l, 'a> ClickBuilder<'l, 'a>
impl<'l, 'a> ClickBuilder<'l, 'a>
Sourcepub fn position(self, x: f64, y: f64) -> Self
pub fn position(self, x: f64, y: f64) -> Self
Set the position offset from the element’s top-left corner.
By default, clicks the center of the element.
Set the mouse button to use.
Sourcepub fn modifiers(self, modifiers: i32) -> Self
pub fn modifiers(self, modifiers: i32) -> Self
Set modifier keys to hold during the click.
Use the modifiers constants from viewpoint_cdp::protocol::input::modifiers.
Sourcepub fn force(self, force: bool) -> Self
pub fn force(self, force: bool) -> Self
Whether to bypass actionability checks.
When true, the click will be performed immediately without waiting
for the element to be visible, enabled, or stable.
Sourcepub async fn send(self) -> Result<(), LocatorError>
pub async fn send(self) -> Result<(), LocatorError>
Execute the click operation.
Trait Implementations§
Source§impl<'l, 'a> Debug for ClickBuilder<'l, 'a>
impl<'l, 'a> Debug for ClickBuilder<'l, 'a>
Source§impl<'l> IntoFuture for ClickBuilder<'l, '_>
impl<'l> IntoFuture for ClickBuilder<'l, '_>
Source§type IntoFuture = Pin<Box<dyn Future<Output = <ClickBuilder<'l, '_> as IntoFuture>::Output> + Send + 'l>>
type IntoFuture = Pin<Box<dyn Future<Output = <ClickBuilder<'l, '_> as IntoFuture>::Output> + Send + 'l>>
Which kind of future are we turning this into?
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more
Auto Trait Implementations§
impl<'l, 'a> Freeze for ClickBuilder<'l, 'a>
impl<'l, 'a> !RefUnwindSafe for ClickBuilder<'l, 'a>
impl<'l, 'a> Send for ClickBuilder<'l, 'a>
impl<'l, 'a> Sync for ClickBuilder<'l, 'a>
impl<'l, 'a> Unpin for ClickBuilder<'l, 'a>
impl<'l, 'a> !UnwindSafe for ClickBuilder<'l, 'a>
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