Class ListSelectElement

  • All Implemented Interfaces:
    com.vaadin.testbench.commands.CanCompareScreenshots, com.vaadin.testbench.commands.CanWaitForVaadin, com.vaadin.testbench.commands.TestBenchElementCommands, com.vaadin.testbench.HasDriver, com.vaadin.testbench.HasSearchContext, com.vaadin.testbench.HasTestBenchCommandExecutor, org.openqa.selenium.SearchContext, org.openqa.selenium.TakesScreenshot, org.openqa.selenium.WebElement, org.openqa.selenium.WrapsElement

    public class ListSelectElement
    extends AbstractSelectElement
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      Clear operation is not supported for List Select.
      void deselectByText​(String text)
      Deselects the option(s) with the given text.
      List<String> getOptions()
      Gets a list of the texts shown for all options.
      org.openqa.selenium.WebElement getSelectElement()
      Gets the <select> element inside the component.
      String getValue()
      Return value of the list select element.
      protected void init()  
      void selectByText​(String text)
      Selects the option with the given text.
      • Methods inherited from class com.vaadin.testbench.TestBenchElement

        click, click, clickHiddenElement, compareScreen, compareScreen, compareScreen, contextClick, doubleClick, equals, findElement, findElements, focus, getAccessibleName, getAriaRole, getAttribute, getCapabilities, getClassNames, getCommandExecutor, getContext, getCssValue, getDomAttribute, getDriver, getId, getLocation, getRect, getScreenshotAs, getShadowRoot, getSize, getTagName, getText, getWrappedElement, hasAttribute, hasClassName, hashCode, init, isChrome, isDisplayed, isEnabled, isFirefox, isFocused, isSelected, scroll, scrollIntoView, scrollLeft, sendKeys, showTooltip, submit, waitForVaadin, waitUntil, waitUntil, wrap, wrapElement, wrapElements
      • Methods inherited from class com.vaadin.testbench.AbstractHasTestBenchCommandExecutor

        $, $$, isElementPresent, isElementPresent
      • Methods inherited from interface org.openqa.selenium.WebElement

        getDomProperty
    • Constructor Detail

      • ListSelectElement

        public ListSelectElement()
    • Method Detail

      • init

        protected void init()
        Overrides:
        init in class com.vaadin.testbench.TestBenchElement
      • selectByText

        public void selectByText​(String text)
        Selects the option with the given text.

        For a ListSelect in multi select mode, adds the given option(s) to the current selection.

        Parameters:
        text - the text of the option
      • deselectByText

        public void deselectByText​(String text)
        Deselects the option(s) with the given text.
        Parameters:
        text - the text of the option
      • getOptions

        public List<String> getOptions()
        Gets a list of the texts shown for all options.
        Returns:
        a list of option texts
      • clear

        public void clear()
        Clear operation is not supported for List Select. This operation has no effect on List Select element.
        Specified by:
        clear in interface org.openqa.selenium.WebElement
        Overrides:
        clear in class AbstractSelectElement
      • getValue

        public String getValue()
        Return value of the list select element.
        Returns:
        value of the list select element
      • getSelectElement

        public org.openqa.selenium.WebElement getSelectElement()
        Gets the <select> element inside the component.
        Returns:
        the select element inside the component
        Since:
        8.1.1