protected static class ComboBox.HtmlSelect extends EmbeddedObject implements ComboBox.Selectable
ComboBox.Selectable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_NAME
traditional HTML tag <select>
|
protected boolean |
isMulti |
static java.lang.String[] |
supportedClazzes |
parent
Constructor and Description |
---|
HtmlSelect(Component component)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
clearCache() |
void |
deselectAll()
Clear all selected entries.
|
void |
deselectByIndex(int index)
Deselect the option at the given index.
|
void |
deselectByValue(java.lang.String value)
Deselect all options that have a value matching the argument.
|
void |
deselectByVisibleText(java.lang.String text)
Deselect all options that display text matching the argument.
|
protected java.lang.String |
escapeQuotes(java.lang.String toEscape) |
java.util.List<Option> |
getAllSelectedOptions() |
java.util.List<java.lang.String> |
getAllSelectedOptionsText() |
Option |
getFirstSelectedOption() |
Option |
getItemByIndex(int index) |
protected java.lang.String |
getLongestSubstringWithoutSpace(java.lang.String s) |
java.util.List<Option> |
getOptions() |
java.util.List<java.lang.String> |
getOptionsValue() |
java.util.List<java.lang.String> |
getOptionsVisibleText() |
java.lang.String |
getOptionValue(int index) |
java.lang.String |
getOptionVisibleText(int index) |
java.lang.String[] |
getSupportedClassNames() |
void |
hidePopup() |
boolean |
isMultiple() |
protected boolean |
isSelected(java.lang.Object option) |
boolean |
isSupported(org.openqa.selenium.WebElement element)
The element will be used to create an instance of class
ComboBox.HtmlSelect or subclass. |
void |
selectByIndex(int index)
Select the option at the given index.
|
void |
selectByValue(java.lang.String value)
Select all options that have a value matching the argument.
|
void |
selectByVisibleText(java.lang.String text)
Select all options that display text matching the argument.
|
protected boolean |
selectOption(java.lang.Object option) |
protected void |
setSelected(java.lang.Object option) |
void |
showPopup() |
isShowOnPage, refresh, webelement
public static final java.lang.String CLASS_NAME
public static final java.lang.String[] supportedClazzes
protected final boolean isMulti
public HtmlSelect(Component component) throws SeleniumPlusException
isSupported(WebElement)
to see if element is supported.SeleniumPlusException.CODE_TYPE_IS_WRONG
.webelement
- SELECT element to wrap, such as html tag <select>, dijit.form.ComboBox, or dijit.form.Select etcSeleniumPlusException
- when element is not supported as a combo box.public void clearCache()
clearCache
in interface IOperable
public boolean isSupported(org.openqa.selenium.WebElement element)
ComboBox.HtmlSelect
or subclass. HtmlSelect#HtmlSelect(WebElement)
or constructor of subclass,ComboBox.HtmlSelect
or subclass.isSupported
in interface Supportable
isSupported
in class EmbeddedObject
element
- WebElement, the element to check.public java.lang.String[] getSupportedClassNames()
getSupportedClassNames
in interface Supportable
public Option getItemByIndex(int index)
getItemByIndex
in interface ComboBox.Selectable
index
- int, the index for an option, 0-based.public boolean isMultiple()
isMultiple
in interface ComboBox.Selectable
public java.util.List<Option> getOptions()
getOptions
in interface ComboBox.Selectable
public java.util.List<java.lang.String> getOptionsVisibleText()
getOptionsVisibleText
in interface ComboBox.Selectable
public java.util.List<java.lang.String> getOptionsValue()
getOptionsValue
in interface ComboBox.Selectable
public java.lang.String getOptionVisibleText(int index)
getOptionVisibleText
in interface ComboBox.Selectable
index
- int, the index for an option, 0-based.public java.lang.String getOptionValue(int index)
getOptionValue
in interface ComboBox.Selectable
index
- int, the index for an option, 0-based.public java.util.List<Option> getAllSelectedOptions()
getAllSelectedOptions
in interface ComboBox.Selectable
public java.util.List<java.lang.String> getAllSelectedOptionsText()
getAllSelectedOptionsText
in interface ComboBox.Selectable
public Option getFirstSelectedOption()
getFirstSelectedOption
in interface ComboBox.Selectable
public void selectByVisibleText(java.lang.String text)
selectByVisibleText
in interface ComboBox.Selectable
text
- The visible text to match againstprotected java.lang.String getLongestSubstringWithoutSpace(java.lang.String s)
public void selectByIndex(int index)
selectByIndex
in interface ComboBox.Selectable
index
- The option at this index will be selectedpublic void selectByValue(java.lang.String value)
selectByValue
in interface ComboBox.Selectable
value
- The value to match againstpublic void deselectAll()
deselectAll
in interface ComboBox.Selectable
java.lang.UnsupportedOperationException
- If the SELECT does not support multiple selectionspublic void deselectByValue(java.lang.String value)
deselectByValue
in interface ComboBox.Selectable
value
- The value to match againstpublic void deselectByIndex(int index)
deselectByIndex
in interface ComboBox.Selectable
index
- The option at this index will be deselectedpublic void deselectByVisibleText(java.lang.String text)
deselectByVisibleText
in interface ComboBox.Selectable
text
- The visible text to match againstprotected java.lang.String escapeQuotes(java.lang.String toEscape)
protected boolean isSelected(java.lang.Object option)
protected boolean selectOption(java.lang.Object option)
protected void setSelected(java.lang.Object option)
public void hidePopup() throws SeleniumPlusException
hidePopup
in interface ComboBox.Selectable
SeleniumPlusException
public void showPopup() throws SeleniumPlusException
showPopup
in interface ComboBox.Selectable
SeleniumPlusException
Copyright © SAS Institute. All Rights Reserved.