public class SelectElement extends TestBenchElement
<select>
element.Constructor and Description |
---|
SelectElement() |
Modifier and Type | Method and Description |
---|---|
String |
getSelectedText()
Gets the text of the currently selected option.
|
String |
getValue()
Gets the value of the currently selected option.
|
void |
selectByText(String text)
Selects the first option matching the given text.
|
void |
setValue(String value)
Selects the option with the given value.
|
callFunction, clear, click, click, compareScreen, compareScreen, compareScreen, contextClick, dispatchEvent, doubleClick, equals, executeScript, findElement, findElements, focus, getAttribute, getCapabilities, getClassNames, getCommandExecutor, getContext, getCssValue, getDriver, getLocation, getProperty, getPropertyBoolean, getPropertyDouble, getPropertyElement, getPropertyElements, getPropertyInteger, getPropertyString, getRect, getScreenshotAs, getSize, getTagName, getText, getWrappedElement, hasAttribute, hasClassName, hashCode, init, init, isChrome, isDisplayed, isEnabled, isFirefox, isIE, isSelected, scroll, scrollIntoView, scrollLeft, sendKeys, setProperty, setProperty, setProperty, setProperty, submit, waitForVaadin, waitUntil, waitUntil, wrap, wrapElement, wrapElements
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
$, $
public void selectByText(String text)
text
- the text of the option to selectpublic String getSelectedText()
public void setValue(String value)
To select based on the visible text, use selectByText(String)
.
value
- the value to selectpublic String getValue()
To get the visible text, use getSelectedText()
.
Copyright © 2019. All rights reserved.