Class DeselectFromOptions
java.lang.Object
net.serenitybdd.screenplay.playwright.interactions.DeselectFromOptions
Deselect options from a multi-select dropdown by text, value or index.
This is the inverse of
SelectFromOptions for multi-select elements.
Sample usage:
// Deselect by value
actor.attemptsTo(DeselectFromOptions.byValue("option1", "option2").from("#multi-select"));
// Deselect by visible text
actor.attemptsTo(DeselectFromOptions.byVisibleText("Option Label").from(DROPDOWN));
// Deselect by index
actor.attemptsTo(DeselectFromOptions.byIndex(0).from("#multi-select"));
// Deselect all options
actor.attemptsTo(DeselectFromOptions.all().from("#multi-select"));
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for deselecting all options. -
Constructor Summary
ConstructorsConstructorDescriptionDeselectFromOptions(net.serenitybdd.screenplay.playwright.interactions.DeselectStrategy strategy) -
Method Summary
Modifier and TypeMethodDescriptionall()Deselect all currently selected options.static DeselectFromOptionsbyIndex(int indexValue) Deselect an option by its index (0-based).static DeselectFromOptionsDeselect options by their value attributes.static DeselectFromOptionsbyVisibleText(String visibleText) Deselect an option by its visible text.net.serenitybdd.screenplay.PerformableSpecify the dropdown to deselect from using a CSS or XPath selector.net.serenitybdd.screenplay.PerformableSpecify the dropdown to deselect from using a Target.
-
Constructor Details
-
DeselectFromOptions
public DeselectFromOptions(net.serenitybdd.screenplay.playwright.interactions.DeselectStrategy strategy)
-
-
Method Details
-
byValue
Deselect options by their value attributes.- Parameters:
values- The values to deselect- Returns:
- A DeselectFromOptions builder
-
byVisibleText
Deselect an option by its visible text.- Parameters:
visibleText- The visible text of the option to deselect- Returns:
- A DeselectFromOptions builder
-
byIndex
Deselect an option by its index (0-based).- Parameters:
indexValue- The index of the option to deselect- Returns:
- A DeselectFromOptions builder
-
all
Deselect all currently selected options.- Returns:
- A builder that will deselect all options
-
from
Specify the dropdown to deselect from using a CSS or XPath selector.- Parameters:
cssOrXpathForElement- The selector for the dropdown- Returns:
- A Performable that deselects the specified options
-
from
Specify the dropdown to deselect from using a Target.- Parameters:
target- The Target for the dropdown- Returns:
- A Performable that deselects the specified options
-