DropDownActions
Static methodsâ
onDropDown
â
This will return IDropDownActions
which will expose different methods to handle drop down actions.
IDropDownActions dropDownActions = DropDownActions.onDropDown ();
Instance methodsâ
deselectAll
â
This method will deselect all the options of the given multi-select element.
import static io.github.boykaframework.actions.elements.DropDownActions.onDropDown;
. . .
onDropDown (multiSelectLocator).deselectAll ();
deselectByIndex (index)
â
This method will deselect the option of the given dropdown / multi-select element by the given index.
import static io.github.boykaframework.actions.elements.DropDownActions.onDropDown;
. . .
onDropDown (dropdownLocator).deselectByIndex (1);
deselectByText (text)
â
This method will deselect the option of the given dropdown / multi-select element by the given text.
import static io.github.boykaframework.actions.elements.DropDownActions.onDropDown;
. . .
onDropDown (dropdownLocator).deselectByText ("Option 1");
deselectByValue (value)
â
This method will deselect the option of the given dropdown / multi-select element by the given value.
import static io.github.boykaframework.actions.elements.DropDownActions.onDropDown;
. . .
onDropDown (dropdownLocator).deselectByValue ("val1");
selectByIndex (index)
â
This method will select the option of the given dropdown / multi-select element by the given index.
import static io.github.boykaframework.actions.elements.DropDownActions.onDropDown;
. . .
onDropDown (dropdownLocator).selectByIndex (2);
selectByText (text)
â
This method will select the option of the given dropdown / multi-select element by the given text.
import static io.github.boykaframework.actions.elements.DropDownActions.onDropDown;
. . .
onDropDown (dropdownLocator).selectByText ("Option 2");
selectByValue (value)
â
This method will select the option of the given dropdown / multi-select element by the given value.
import static io.github.boykaframework.actions.elements.DropDownActions.onDropDown;
. . .
onDropDown (dropdownLocator).selectByValue ("value-2");
selectedItem
â
This method will return the selected item text of the given dropdown / multi-select element.
import static io.github.boykaframework.actions.elements.DropDownActions.onDropDown;
. . .
String itemText = onDropDown (dropdownLocator).selectedItem ();
selectedItems
â
This method will return the list of selected item texts of the given multi-select element.
import static io.github.boykaframework.actions.elements.DropDownActions.onDropDown;
. . .
List<String> itemTexts = onDropDown (dropdownLocator).selectedItems (dropdownLocator);
verifySelectedItem
â
This method will verify the selected item from the drop down.
import static io.github.boykaframework.actions.elements.DropDownActions.onDropDown;
. . .
onDropDown (dropdownLocator).verifySelectedItem ().isEqualTo ("Batman");
verifySelectedItems
â
This method will verify the list of selected items from the drop down.
import static io.github.boykaframework.actions.elements.DropDownActions.onDropDown;
. . .
onDropDown (dropdownLocator).verifySelectedItems ().containsExactly ("The Avengers", "Batman", "Black Panther");