public abstract class AbstractHierarchicalSelectable extends AbstractSelectable
#getMatchedElement(String, boolean, int)
contentObjects, DEFAULT_WAIT_TIME
parent
Constructor and Description |
---|
AbstractHierarchicalSelectable(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 HierarchicalElement |
convertTo(Element element)
Cast the an Element object to HierarchicalElement.
Subclass needs to override this method to cast it to its own type. |
HierarchicalElement |
getMatchedElement(TextMatchingCriterion criteria)
According to the "hierarchical path" to get a Element object.
The sub-class needs to provide an appropriate implementation of method AbstractSelectable.getContent() , on whichthis method depends. |
(package private) HierarchicalElement |
getMatchedNode(HierarchicalElement[] hierarchicalStructure,
java.lang.String[] pathNodes,
boolean partialMatch,
int[] expectedMatchTimes)
According to a pathNodes (an array of path) and expectedMatchTimes (an array of int), find the matched node in a hierarchical structure.
If at certain level, the expectedMatchedTime is not satisfied, then the search will fail and just return a null. |
(package private) HierarchicalElement |
getMatchedNode(HierarchicalElement[] hierarchicalStructure,
java.lang.String[] pathNodes,
boolean partialMatch,
MutableInteger matchedTimes,
int expectedMatchTimes)
According to a pathNodes (an array of path) and expectedMatchTimes, find the Nth-matched node in a hierarchical structure.
|
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'.
|
void |
verifyItemSelection(int index,
boolean expectSelected)
Verify the item (specified by index) is selected or un-selected.
|
activateItem, clearCache, clickElement, getCacheableContent, getContent, selectItem, showOnPage, verifyContains, verifyItemSelected, verifyItemSelection, verifyItemSelection, waitAndVerifyItemSelected, waitElementReady, waitElementReady
isShowOnPage, isSupported, refresh, webelement
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSupportedClassNames
public AbstractHierarchicalSelectable(Component parent) throws SeleniumPlusException
parent
- SeleniumPlusException
public void selectItem(int index, boolean verify, org.openqa.selenium.Keys key, java.awt.Point offset, int mouseButtonNumber) throws SeleniumPlusException
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
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
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.public HierarchicalElement getMatchedElement(TextMatchingCriterion criteria) throws SeleniumPlusException
AbstractSelectable.getContent()
, on whichpath
- String, the hierarchical path, "root->node1" for example. The path should be separated by GuiObjectRecognition.DEFAULT_PATH_SEPARATOR
SeleniumPlusException
- if Element cannot be foundAbstractSelectable.getContent()
HierarchicalElement getMatchedNode(HierarchicalElement[] hierarchicalStructure, java.lang.String[] pathNodes, boolean partialMatch, MutableInteger matchedTimes, int expectedMatchTimes) throws SeleniumPlusException
hierarchicalStructure
- HierarchicalElement[], the hierarchical structure where to find the matched node.pathNodes
- String[], an array of node path to matchpartialMatch
- boolean, if the pathNodes contains partial string or full string to matchmatchedTimes
- MutableInteger, how many times that the node-path has been found.expectedMatchTimes
- int, the expected times that the node-path should be found.SeleniumPlusException
HierarchicalElement getMatchedNode(HierarchicalElement[] hierarchicalStructure, java.lang.String[] pathNodes, boolean partialMatch, int[] expectedMatchTimes) throws SeleniumPlusException
hierarchicalStructure
- HierarchicalElement[], the hierarchical structure where to find the matched node.pathNodes
- String[], an array of node path to matchpartialMatch
- boolean, if the pathNodes contains partial string or full string to matchexpectedMatchTimes
- int[], an array of int, each int value represents the expected times that the node-path should be found at its level.SeleniumPlusException
protected HierarchicalElement convertTo(Element element) throws SeleniumPlusException
element
- Element, the Element object to castSeleniumPlusException
- if the Element object cannot be cast to HierarchicalElement.Copyright © SAS Institute. All Rights Reserved.