Class SelectElement

java.lang.Object
com.vaadin.testbench.TestBenchElement
com.vaadin.flow.component.select.testbench.SelectElement
All Implemented Interfaces:
CanCompareScreenshots, HasCallFunction, HasDriver, HasElementQuery, HasHelper, HasLabel, HasPlaceholder, HasPropertySettersGetters, HasSearchContext, HasSelectByText, HasTestBenchCommandExecutor, org.openqa.selenium.SearchContext, org.openqa.selenium.TakesScreenshot, org.openqa.selenium.WebElement, org.openqa.selenium.WrapsElement

public class SelectElement extends TestBenchElement implements HasSelectByText, HasLabel, HasPlaceholder, HasHelper
Testbench Element API for vaadin-select.
  • Constructor Details

    • SelectElement

      public SelectElement()
  • Method Details

    • openPopup

      public void openPopup()
      Opens the popup with options, if it is not already open.
    • closePopup

      public void closePopup()
      Closes the popup with options, if it is open.
    • isOpened

      public boolean isOpened()
    • selectItemByIndex

      public void selectItemByIndex(int index)
    • getItemsStream

      public Stream<SelectElement.ItemElement> getItemsStream()
    • getItems

      public List<SelectElement.ItemElement> getItems()
    • selectByText

      public void selectByText(String text)
      Description copied from interface: HasSelectByText
      Selects the first option matching the given text.
      Specified by:
      selectByText in interface HasSelectByText
      Parameters:
      text - the text of the option to select
    • getSelectedText

      public String getSelectedText()
      Description copied from interface: HasSelectByText
      Gets the text of the currently selected option.
      Specified by:
      getSelectedText in interface HasSelectByText
      Returns:
      the text of the current option
    • getSelectedOptionItem

      public SelectElement.ItemElement getSelectedOptionItem()
    • getSelectedItem

      public SelectElement.ItemElement getSelectedItem()