class Menu.DefaultSelectable_Menu extends AbstractMenuSelectable
contentObjects, DEFAULT_WAIT_TIME
parent
Constructor and Description |
---|
DefaultSelectable_Menu(Component parent) |
Modifier and Type | Method and Description |
---|---|
protected void |
expandItem(MenuItem node,
boolean expandChildren)
Expand the nodes (by double-click) from the root level by level.
Note:The second parameter expandChildren is not used yet here. |
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)
This method override that of superclass.
|
java.lang.String[] |
getSupportedClassNames() |
protected boolean |
isShowOnPage(Element element)
For menu, the menuitem is usually NOT shown on page.
The method EmbeddedObject.isShowOnPage(Element) in super-class willtry to search the related web-element (which doesn't exist yet) and will waste a lot of time. So override it, and just return false, so that we will always call showOnPage(Element) to make it visible on page and can be selected correctly. |
boolean |
isSupported(org.openqa.selenium.WebElement element)
Test if the element is supported.
|
protected void |
showOnPage(Element element)
Make the element is in the container, and visible on the page.
For example, some element may not be visible if there are too many elements in its container; User can scroll to make the element visible on the page. User may need to wait for a while so that the element related object can be updated (like position-onscreen, visibility etc.) This method gives a default implementation: it will scroll and align the top of element to the top of container. Before this method is called, it is suggested to call EmbeddedObject.isShowOnPage(Element) firstly. |
convertTo, verifyItemSelected, verifyMenuItem, waitAndVerifyItemSelected
activateItem, selectItem, verifyItemSelection
activateItem, clearCache, clickElement, getCacheableContent, selectItem, verifyContains, verifyItemSelection, verifyItemSelection, waitElementReady, waitElementReady
refresh, webelement
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
activateItem, activateItem, selectItem, selectItem, verifyContains, verifyItemSelection, verifyItemSelection
clearCache
public DefaultSelectable_Menu(Component parent) throws SeleniumPlusException
parent
- SeleniumPlusException
public boolean isSupported(org.openqa.selenium.WebElement element)
EmbeddedObject
isSupported
in interface Supportable
isSupported
in class EmbeddedObject
element
- WebElement, the element to check.public java.lang.String[] getSupportedClassNames()
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 AbstractMenuSelectable
SeleniumPlusException
AbstractSelectable.getCacheableContent()
public MenuItem getMatchedElement(TextMatchingCriterion criterion) throws SeleniumPlusException
getMatchedElement
in interface IMenuSelectable
getMatchedElement
in interface ISelectable
getMatchedElement
in class AbstractMenuSelectable
criterion
- TextMatchingCriterion, containing text, partialMatch, matchedIndex as search-criterion.SeleniumPlusException
- if Element cannot be foundAbstractSelectable.getContent()
protected void showOnPage(Element element) throws SeleniumPlusException
AbstractSelectable
EmbeddedObject.isShowOnPage(Element)
firstly.showOnPage
in class AbstractSelectable
element
- Element, the element needs to be visible on pageSeleniumPlusException
#isShowOnPage(Element)}
protected void expandItem(MenuItem node, boolean expandChildren) throws SeleniumPlusException
SeleniumPlusException
protected boolean isShowOnPage(Element element) throws SeleniumPlusException
EmbeddedObject.isShowOnPage(Element)
in super-class willshowOnPage(Element)
isShowOnPage
in class EmbeddedObject
element
- Element, the element to checkSeleniumPlusException
EmbeddedObject.isShowOnPage(Element)
Copyright © SAS Institute. All Rights Reserved.