public class SelectList extends HtmlElement
Modifier and Type | Field and Description |
---|---|
protected List<org.openqa.selenium.WebElement> |
options |
protected org.openqa.selenium.support.ui.Select |
select |
driver, element, logger, webUXDriver
Constructor and Description |
---|
SelectList(String text,
org.openqa.selenium.By by) |
Modifier and Type | Method and Description |
---|---|
void |
deselectAll()
De-selects all options in a multi-select list element.
|
void |
deselectByIndex(int index) |
void |
deselectByText(String text) |
void |
deselectByValue(String value) |
protected void |
findElement()
Finds the element using By type.
|
protected org.openqa.selenium.support.ui.Select |
getNewSelectElement(org.openqa.selenium.WebElement element)
Returns a new Select element (created to facilitate unit testing).
|
List<org.openqa.selenium.WebElement> |
getOptions() |
String |
getSelectedText() |
String[] |
getSelectedTexts() |
String |
getSelectedValue() |
String[] |
getSelectedValues() |
void |
init()
Refreshes the WebUIDriver before locating the element, to ensure we have the current version (useful for when the
state of an element has changed via an AJAX or non-page-turn action).
|
boolean |
isMultiple() |
void |
selectByIndex(int index) |
void |
selectByIndex(int[] indexs) |
void |
selectByText(String text)
Select standard select by attribute text, and select fake select with ul and li by attribute title.
|
void |
selectByText(String[] texts) |
void |
selectByValue(String value) |
void |
selectByValue(String[] values) |
captureSnapshot, captureSnapshot, click, clickAt, clickAt, getAllElements, getAttribute, getBy, getCssValue, getDriver, getElement, getEval, getHeight, getLabel, getLocation, getLocator, getSize, getTagName, getText, getValue, getWidth, isDisplayed, isElementPresent, isEnabled, isSelected, isTextPresent, mouseDown, mouseOver, mouseUp, sendKeys, simulateClick, simulateMouseOver, simulateMoveToElement, sleep, toHTML, toString, waitForPresent, waitForPresent
protected org.openqa.selenium.support.ui.Select select
protected List<org.openqa.selenium.WebElement> options
public SelectList(String text, org.openqa.selenium.By by)
public void deselectAll()
public void deselectByIndex(int index)
public void deselectByText(String text)
public void deselectByValue(String value)
protected void findElement()
HtmlElement
findElement
in class HtmlElement
protected org.openqa.selenium.support.ui.Select getNewSelectElement(org.openqa.selenium.WebElement element)
public List<org.openqa.selenium.WebElement> getOptions()
public String getSelectedText()
public String[] getSelectedTexts()
public String getSelectedValue()
public String[] getSelectedValues()
public void init()
HtmlElement
init
in class HtmlElement
public boolean isMultiple()
public void selectByIndex(int index)
public void selectByIndex(int[] indexs)
public void selectByText(String text)
text
- public void selectByText(String[] texts)
public void selectByValue(String value)
public void selectByValue(String[] values)
Copyright © 2017. All rights reserved.