Class ComboBox

  • All Implemented Interfaces:
    org.openqa.selenium.interactions.Locatable, org.openqa.selenium.SearchContext, org.openqa.selenium.TakesScreenshot, org.openqa.selenium.WebElement, org.openqa.selenium.WrapsDriver

    public class ComboBox
    extends DesktopElement
    • Constructor Detail

      • ComboBox

        public ComboBox​(org.openqa.selenium.WebElement element)
    • Method Detail

      • collapse

        public void collapse()
        Collapses the element.
      • expand

        public void expand()
        Expands the element.
      • select

        public ComboBoxItem select​(String value)
        Select the first item which matches the given text.
        Parameters:
        value - The text to search for.
        Returns:
        The first found item or null if no item matches.
      • selectIndex

        public ComboBoxItem selectIndex​(int index)
        Select an item by index.
        Parameters:
        index - The index to search for.
        Returns:
        The first found item or null if no item matches.
      • setEditableText

        public void setEditableText​(String value)
        Set the text of the editable element inside the combobox. Only works if the combobox is editable.
      • isEditable

        public boolean isEditable()
        Flag which indicates, if the combobox is editable or not.
      • isReadOnly

        public boolean isReadOnly()
        Flag which indicates, if the combobox is read-only or not.
      • value

        public String value()
        Returns:
        Selected value.
      • selectedItem

        public ComboBoxItem selectedItem()
        Gets the first selected item or null otherwise.
      • selectedItems

        public List<ComboBoxItem> selectedItems()
        Gets all selected items.
      • expandCollapseState

        public ExpandCollapseState expandCollapseState()
        Gets the ExpandCollapseState of the element.
      • editableText

        public String editableText()
        The text of the editable element inside the combobox. Only works if the combobox is editable.