Package com.vaadin.testbench.elements
Class ComboBoxElement
- java.lang.Object
-
- com.vaadin.testbench.AbstractHasTestBenchCommandExecutor
-
- com.vaadin.testbench.TestBenchElement
-
- com.vaadin.testbench.elementsbase.AbstractElement
-
- 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
- Direct Known Subclasses:
SelectElement
public class ComboBoxElement extends AbstractSingleSelectElement
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.vaadin.testbench.elements.AbstractComponentElement
AbstractComponentElement.ReadOnlyException
-
-
Constructor Summary
Constructors Constructor Description ComboBoxElement()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clear operation is not supported for select element classes.org.openqa.selenium.WebElementgetInputField()Returns the text input field element, used for entering text into the combo box.List<org.openqa.selenium.WebElement>getPopupSuggestionElements()Gets the elements of all suggestions on the current page.List<String>getPopupSuggestions()Gets the text representation of all suggestions on the current page.org.openqa.selenium.WebElementgetSuggestionPopup()Returns the suggestion popup element.StringgetText()StringgetValue()Return value of the combo box element.booleanisPopupOpen()Checks whether the suggestion popup is open or not.booleanisTextInputAllowed()Checks if text input is allowed for the combo box.booleanopenNextPage()Opens next popup page.voidopenPopup()Open the suggestion popup.booleanopenPrevPage()Open previous popup page.voidselectByText(String text)Selects the first option in the ComboBox which matches the given text.voidsendKeys(int delay, CharSequence... keysToSend)Use this method to simulate typing into an element, which may set its value.voidsendKeys(CharSequence... keysToSend)-
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, getWrappedElement, hasAttribute, hasClassName, hashCode, init, init, isChrome, isDisplayed, isEnabled, isFirefox, isFocused, isSelected, scroll, scrollIntoView, scrollLeft, showTooltip, submit, waitForVaadin, waitUntil, waitUntil, wrap, wrapElement, wrapElements
-
Methods inherited from class com.vaadin.testbench.AbstractHasTestBenchCommandExecutor
$, $$, isElementPresent, isElementPresent
-
-
-
-
Method Detail
-
selectByText
public void selectByText(String text)
Selects the first option in the ComboBox which matches the given text.- Specified by:
selectByTextin classAbstractSingleSelectElement- Parameters:
text- the text of the option to select
-
isTextInputAllowed
public boolean isTextInputAllowed()
Checks if text input is allowed for the combo box.- Returns:
trueif text input is allowed,falseotherwise
-
isPopupOpen
public boolean isPopupOpen()
Checks whether the suggestion popup is open or not.- Returns:
trueif popup is open,false if not
-
openPopup
public void openPopup()
Open the suggestion popup.
-
getPopupSuggestions
public List<String> getPopupSuggestions()
Gets the text representation of all suggestions on the current page.- Returns:
- List of suggestion texts
-
getPopupSuggestionElements
public List<org.openqa.selenium.WebElement> getPopupSuggestionElements()
Gets the elements of all suggestions on the current page.Opens the popup if not already open.
- Returns:
- a list of elements for the suggestions on the current page
-
openNextPage
public boolean openNextPage()
Opens next popup page.- Returns:
- True if next page opened. false if doesn't have next page
-
openPrevPage
public boolean openPrevPage()
Open previous popup page.- Returns:
- True if previous page opened. False if doesn't have previous page
-
getSuggestionPopup
public org.openqa.selenium.WebElement getSuggestionPopup()
Returns the suggestion popup element.
-
getValue
public String getValue()
Return value of the combo box element.- Specified by:
getValuein classAbstractSingleSelectElement- Returns:
- value of the combo box element
-
getInputField
public org.openqa.selenium.WebElement getInputField()
Returns the text input field element, used for entering text into the combo box.- Returns:
- the input field element
-
getText
public String getText()
- Specified by:
getTextin interfaceorg.openqa.selenium.WebElement- Overrides:
getTextin classcom.vaadin.testbench.TestBenchElement
-
clear
public void clear()
Description copied from class:AbstractSelectElementClear operation is not supported for select element classes. This operation has no effect on select element- Specified by:
clearin interfaceorg.openqa.selenium.WebElement- Overrides:
clearin classAbstractSelectElement
-
sendKeys
public void sendKeys(CharSequence... keysToSend)
- Specified by:
sendKeysin interfaceorg.openqa.selenium.WebElement- Overrides:
sendKeysin classcom.vaadin.testbench.TestBenchElement
-
sendKeys
public void sendKeys(int delay, CharSequence... keysToSend)Use this method to simulate typing into an element, which may set its value.- Parameters:
delay- delay after sending each individual key (mainly needed for PhantomJS)keysToSend- keys to type into the element
-
-