Package com.vaadin.testbench.elements
Class NativeSelectElement
- java.lang.Object
-
- com.vaadin.testbench.AbstractHasTestBenchCommandExecutor
-
- com.vaadin.testbench.TestBenchElement
-
- com.vaadin.testbench.elementsbase.AbstractElement
-
- com.vaadin.testbench.elements.AbstractComponentElement
-
- com.vaadin.testbench.elements.AbstractFieldElement
-
- com.vaadin.testbench.elements.AbstractSelectElement
-
- com.vaadin.testbench.elements.AbstractSingleSelectElement
-
- com.vaadin.testbench.elements.NativeSelectElement
-
- 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 NativeSelectElement extends AbstractSingleSelectElement
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.vaadin.testbench.elements.AbstractComponentElement
AbstractComponentElement.ReadOnlyException
-
-
Constructor Summary
Constructors Constructor Description NativeSelectElement()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clear operation is not supported for Native Select.List<com.vaadin.testbench.TestBenchElement>getOptions()org.openqa.selenium.WebElementgetSelectElement()Gets the<select>element inside the component.StringgetValue()Return value of the selected item in the native select element.protected voidinit()voidselectByText(String text)Selects the first option in this single select component that matches the given text.voidsetValue(CharSequence chars)Select item of the native select element with the specified value.-
Methods inherited from class com.vaadin.testbench.elements.AbstractFieldElement
clearElementClientSide, clientSelectElement
-
Methods inherited from class com.vaadin.testbench.elements.AbstractComponentElement
getCaption, getHTML, getStyleAttribute, isReadOnly
-
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
-
-
-
-
Method Detail
-
init
protected void init()
- Overrides:
initin classcom.vaadin.testbench.TestBenchElement
-
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
-
getOptions
public List<com.vaadin.testbench.TestBenchElement> getOptions()
-
selectByText
public void selectByText(String text) throws AbstractComponentElement.ReadOnlyException
Description copied from class:AbstractSingleSelectElementSelects the first option in this single select component that matches the given text.- Specified by:
selectByTextin classAbstractSingleSelectElement- Parameters:
text- the text to select by- Throws:
AbstractComponentElement.ReadOnlyException
-
clear
public void clear()
Clear operation is not supported for Native Select. This operation has no effect on Native Select element.- Specified by:
clearin interfaceorg.openqa.selenium.WebElement- Overrides:
clearin classAbstractSelectElement
-
getValue
public String getValue() throws org.openqa.selenium.NoSuchElementException
Return value of the selected item in the native select element.- Specified by:
getValuein classAbstractSingleSelectElement- Returns:
- value of the selected item
- Throws:
org.openqa.selenium.NoSuchElementException- if no value is selected
-
setValue
public void setValue(CharSequence chars) throws AbstractComponentElement.ReadOnlyException
Select item of the native select element with the specified value.- Parameters:
chars- value of the native select item will be selected- Throws:
AbstractComponentElement.ReadOnlyException
-
-