public abstract class AbstractMenuSelectable extends AbstractHierarchicalSelectable implements IMenuSelectable
contentObjects, DEFAULT_WAIT_TIME
parent
Constructor and Description |
---|
AbstractMenuSelectable(Component parent) |
Modifier and Type | Method and Description |
---|---|
protected MenuItem |
convertTo(Element element)
Cast the Element to MenuItem.
|
MenuItem[] |
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() |
MenuItem |
getMatchedElement(TextMatchingCriterion criterion)
According to the "hierarchical path" to get a MenuItem object.
|
protected void |
verifyItemSelected(Element element)
As it is hard to know if a MenuItem has been selected, it is so transient.
|
void |
verifyMenuItem(TextMatchingCriterion criterion,
java.lang.String expectedStatus) |
protected void |
waitAndVerifyItemSelected(Element element)
Override the method in super-class to turn off the post-verification, we just log a debug message.
|
activateItem, getMatchedNode, getMatchedNode, selectItem, verifyItemSelection
activateItem, clearCache, clickElement, getCacheableContent, selectItem, showOnPage, verifyContains, verifyItemSelection, verifyItemSelection, waitElementReady, waitElementReady
isShowOnPage, isSupported, refresh, webelement
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
activateItem, activateItem, selectItem, selectItem, verifyContains, verifyItemSelection, verifyItemSelection
clearCache
getSupportedClassNames
public AbstractMenuSelectable(Component parent) throws SeleniumPlusException
parent
- SeleniumPlusException
public MenuItem[] getContent() throws SeleniumPlusException
AbstractSelectable
AbstractSelectable.getCacheableContent()
,AbstractSelectable.getCacheableContent()
getContent
in interface IHierarchicalSelectable
getContent
in interface IMenuSelectable
getContent
in interface ISelectable
getContent
in class AbstractSelectable
SeleniumPlusException
AbstractSelectable.getCacheableContent()
public MenuItem getMatchedElement(TextMatchingCriterion criterion) throws SeleniumPlusException
getMatchedElement
in interface IMenuSelectable
getMatchedElement
in interface ISelectable
getMatchedElement
in class AbstractHierarchicalSelectable
criterion
- TextMatchingCriterion, containing text, partialMatch, matchedIndex as search-criterion.SeleniumPlusException
- if Element cannot be foundAbstractSelectable.getContent()
protected MenuItem convertTo(Element element) throws SeleniumPlusException
convertTo
in class AbstractHierarchicalSelectable
element
- Element, the Element object to castSeleniumPlusException
- if the Element object cannot be cast to HierarchicalElement.protected void waitAndVerifyItemSelected(Element element) throws SeleniumPlusException
AbstractSelectable.waitAndVerifyItemSelected(Element)
will try to refresh the WebElment and then
call verifyItemSelected(Element)
to verify item's selection. But currently
verifyItemSelected(Element)
will do nothing, so it is a time-wasting to refresh the WebElement.
We just override waitAndVerifyItemSelected(Element)
to do nothing but log a debug message.
waitAndVerifyItemSelected
in class AbstractSelectable
element
- Element, the element has been selected or clicked or double-clicked.SeleniumPlusException
#verifyItemSelected(Element)}
protected void verifyItemSelected(Element element) throws SeleniumPlusException
As it is hard to know if a MenuItem has been selected, it is so transient.
For example, MenuItemBase API
does NOT provide a way to get menu item selection status.
So we will do nothing in verifyItemSelected(Element)
, which could be overrode if we know a way to verify menu item selection.
verifyItemSelected
in class AbstractSelectable
element
- Element, the element to verify that it is selected.SeleniumPlusException
public void verifyMenuItem(TextMatchingCriterion criterion, java.lang.String expectedStatus) throws SeleniumPlusException
verifyMenuItem
in interface IMenuSelectable
SeleniumPlusException
Copyright © SAS Institute. All Rights Reserved.