java.lang.Object
net.serenitybdd.screenplay.playwright.interactions.Click
All Implemented Interfaces:
net.serenitybdd.core.SkipNested, net.serenitybdd.screenplay.Performable

public class Click extends Object implements net.serenitybdd.screenplay.Performable
This method clicks an element matching selector by performing the following steps: Find an element match matching selector. If there is none, wait until a matching element is attached to the DOM. Wait for actionability checks on the matched element, unless force option is set. If the element is detached during the checks, the whole action is retried. Scroll the element into view if needed. Use Page.mouse() to click in the center of the element, or the specified position. Wait for initiated navigations to either succeed or fail, unless noWaitAfter option is set. When all steps combined have not finished during the specified timeout, this method rejects with a TimeoutError. Passing zero timeout disables this.

Sample usage:

     Click.on("#searchbutton");
 
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor required by Screenplay
    Click(Target target)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Click
    on(String selector)
     
    static Click
    on(Target target)
     
    <T extends net.serenitybdd.screenplay.Actor>
    void
    performAs(T actor)
     
    net.serenitybdd.screenplay.Performable
    withOptions(com.microsoft.playwright.Locator.ClickOptions options)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.serenitybdd.screenplay.Performable

    then
  • Constructor Details

    • Click

      public Click()
      Default constructor required by Screenplay
    • Click

      public Click(Target target)
  • Method Details

    • on

      public static Click on(String selector)
    • on

      public static Click on(Target target)
    • withOptions

      public net.serenitybdd.screenplay.Performable withOptions(com.microsoft.playwright.Locator.ClickOptions options)
    • performAs

      public <T extends net.serenitybdd.screenplay.Actor> void performAs(T actor)
      Specified by:
      performAs in interface net.serenitybdd.screenplay.Performable