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

net.serenitybdd.screenplay.actions.selectactions.SelectByValueFromElement Maven / Gradle / Ivy

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

import net.serenitybdd.core.pages.WebElementFacade;
import net.serenitybdd.screenplay.Actor;
import net.serenitybdd.screenplay.Interaction;
import net.serenitybdd.annotations.Step;

public class SelectByValueFromElement implements Interaction {
    private WebElementFacade element;
    private String[] values;

    SelectByValueFromElement() {}

    public SelectByValueFromElement(WebElementFacade element, String... values) {
        this.element = element;
        this.values = values;
    }

    @Step("{0} selects #values in #element")
    public  void performAs(T theUser) {
        for(String value : values) {
            element.selectByValue(value);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy