public abstract class AbstractListSelectable extends AbstractSelectable implements IListSelectable
contentObjects, DEFAULT_WAIT_TIME
parent
Constructor and Description |
---|
AbstractListSelectable(Component parent) |
Modifier and Type | Method and Description |
---|---|
void |
activateItem(int index,
boolean verify,
org.openqa.selenium.Keys key,
java.awt.Point offset)
Try to activate (double-click) the item according to the index, and then verify if the item
has been really selected according to the parameter 'verify'.
|
protected Item |
convertToItem(Element element) |
Item[] |
getContent()
Try to get the cached content according to the WebElement.
If no cached content can be found, then get the real-time content by calling AbstractSelectable.getCacheableContent() ,and put the content in the cache and return it. If subclass doesn't need this functionality, then just override this method. If subclass needs this functionality, then override method AbstractSelectable.getCacheableContent() |
Item |
getMatchedElement(TextMatchingCriterion criterion)
according to the element's label to get a Element object.
|
protected Item |
getMatchedItem(int index)
according to the index to get a Item object.
|
void |
selectItem(int index,
boolean verify,
org.openqa.selenium.Keys key,
java.awt.Point offset,
int mouseButtonNumber)
Try to select (single-click) the item according to the index, and then verify if the item
has been really selected according to the parameter 'verify'.
|
protected void |
verifyItemSelected(Element element)
Note:In subclass, we need to update the 'selected' property of Element.
Please call AbstractSelectable.waitAndVerifyItemSelected(Element) instead to verify selection,as the first method will also try the wait for element to be ready and call EmbeddedObject.refresh(boolean) . |
void |
verifyItemSelection(int index,
boolean expectSelected)
Verify the item (specified by index) is selected or un-selected.
|
activateItem, clearCache, clickElement, getCacheableContent, selectItem, showOnPage, verifyContains, verifyItemSelection, verifyItemSelection, waitAndVerifyItemSelected, waitElementReady, waitElementReady
isShowOnPage, isSupported, refresh, webelement
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
activateItem, selectItem, verifyContains, verifyItemSelection
clearCache
getSupportedClassNames
public AbstractListSelectable(Component parent) throws SeleniumPlusException
SeleniumPlusException
public Item[] getContent() throws SeleniumPlusException
AbstractSelectable
AbstractSelectable.getCacheableContent()
,AbstractSelectable.getCacheableContent()
getContent
in interface IListSelectable
getContent
in interface ISelectable
getContent
in class AbstractSelectable
SeleniumPlusException
AbstractSelectable.getCacheableContent()
public Item getMatchedElement(TextMatchingCriterion criterion) throws SeleniumPlusException
ISelectable
getMatchedElement
in interface ISelectable
criterion
- TextMatchingCriterion, containing text, partialMatch, matchedIndex as search-criterion.SeleniumPlusException
- if Element cannot be foundprotected Item getMatchedItem(int index) throws SeleniumPlusException
index
- int, the index of the item.SeleniumPlusException
public void selectItem(int index, boolean verify, org.openqa.selenium.Keys key, java.awt.Point offset, int mouseButtonNumber) throws SeleniumPlusException
ISelectable
selectItem
in interface ISelectable
index
- int, the index of the item to select, it is 0-based index.verify
- boolean, if true then verify the selection;key
- org.openqa.selenium.Keys, it is the key to press during selection.Keys.SHIFT
, or Keys.CONTROL
.offset
- Point, the position relative to the up-left corner to click atmouseButtonNumber
- int, the mouse-button-number representing right, middle, or left button.WDLibrary.MOUSE_BUTTON_LEFT
or WDLibrary.MOUSE_BUTTON_RIGHT
WDLibrary.MOUSE_BUTTON_MIDDLE
.SeleniumPlusException
public void activateItem(int index, boolean verify, org.openqa.selenium.Keys key, java.awt.Point offset) throws SeleniumPlusException
ISelectable
activateItem
in interface ISelectable
index
- int, the index of the item to select, it is 0-based index.verify
- boolean, if true then verify the selection;key
- org.openqa.selenium.Keys, it is the key to press during selection.Keys.SHIFT
, or Keys.CONTROL
.offset
- Point, the position relative to the up-left corner to click atSeleniumPlusException
public void verifyItemSelection(int index, boolean expectSelected) throws SeleniumPlusException
ISelectable
verifyItemSelection
in interface ISelectable
index
- int, the index of the item to select, it is 0-based index.expectSelected
- boolean, true if the item is expected 'selected'; false if expected 'unselected'.SeleniumPlusException
- if the verification fails.protected Item convertToItem(Element element) throws SeleniumPlusException
SeleniumPlusException
protected void verifyItemSelected(Element element) throws SeleniumPlusException
AbstractSelectable
AbstractSelectable.waitAndVerifyItemSelected(Element)
instead to verify selection,EmbeddedObject.refresh(boolean)
.verifyItemSelected
in class AbstractSelectable
element
- Element, the element to verify that it is selected.SeleniumPlusException
Copyright © SAS Institute. All Rights Reserved.