public abstract class AbstractMenuSelectable extends AbstractHierarchicalSelectable implements IMenuSelectable
contentObjects, DEFAULT_WAIT_TIMEparent| 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, verifyItemSelectionactivateItem, clearCache, clickElement, getCacheableContent, selectItem, showOnPage, verifyContains, verifyItemSelection, verifyItemSelection, waitElementReady, waitElementReadyisShowOnPage, isSupported, refresh, webelementclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitactivateItem, activateItem, selectItem, selectItem, verifyContains, verifyItemSelection, verifyItemSelectionclearCachegetSupportedClassNamespublic AbstractMenuSelectable(Component parent) throws SeleniumPlusException
parent - SeleniumPlusExceptionpublic MenuItem[] getContent() throws SeleniumPlusException
AbstractSelectableAbstractSelectable.getCacheableContent(),AbstractSelectable.getCacheableContent()getContent in interface IHierarchicalSelectablegetContent in interface IMenuSelectablegetContent in interface ISelectablegetContent in class AbstractSelectableSeleniumPlusExceptionAbstractSelectable.getCacheableContent()public MenuItem getMatchedElement(TextMatchingCriterion criterion) throws SeleniumPlusException
getMatchedElement in interface IMenuSelectablegetMatchedElement in interface ISelectablegetMatchedElement in class AbstractHierarchicalSelectablecriterion - 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 AbstractHierarchicalSelectableelement - 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 AbstractSelectableelement - 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 AbstractSelectableelement - Element, the element to verify that it is selected.SeleniumPlusExceptionpublic void verifyMenuItem(TextMatchingCriterion criterion, java.lang.String expectedStatus) throws SeleniumPlusException
verifyMenuItem in interface IMenuSelectableSeleniumPlusExceptionCopyright © SAS Institute. All Rights Reserved.