All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.serenitybdd.screenplay.actions.Click Maven / Gradle / Ivy

There is a newer version: 4.2.8
Show newest version
package net.serenitybdd.screenplay.actions;

import net.serenitybdd.model.collect.NewList;
import net.serenitybdd.core.pages.WebElementFacade;
import net.serenitybdd.screenplay.targets.Target;
import org.openqa.selenium.By;

import static net.serenitybdd.screenplay.Tasks.instrumented;

/**
 * Click on a button or element.
 */
public class Click {

    public static ClickInteraction on(String cssOrXpathForElement) {
        return instrumented(ClickOnTarget.class, Target.the(cssOrXpathForElement).locatedBy(cssOrXpathForElement));
    }

    public static ClickInteraction on(Target target) {
        return instrumented(ClickOnTarget.class,target);
    }

    public static ClickInteraction on(WebElementFacade element) {
        return instrumented(ClickOnElement.class, element);
    }

    public static ClickInteraction on(By... locators) {
        return instrumented(ClickOnBy.class, NewList.of(locators));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy