|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.team.fvt.tests.web.WebPageElement
com.ibm.team.fvt.tests.web.WebElementWrapper
com.ibm.team.fvt.tests.web.WebFolderElement
public class WebFolderElement
Class to handle a folder web element in a web page. A folder may contain multiple folders, which may be several levels deep.
Following API features are available on a folder:
collapse()
: Collapse the folder.expand()
: Expand the folder.findFolder(String)
: Search for a folder name in the tree.findFolder(String, String)
: Search for a folder name in the tree
relatively to a given parent.getAllLeaves()
: Return all leaves of the current folder.getAllLeavesPath()
: Return path for all leaves of the current folder.getAllNodes()
: Return all nodes of the current folder.getChild(String)
: Returns the given child folder.getChildren()
: Returns the folder's children.selectFolder(String)
: Selects the given folder. The full folder path must be
specified to access the sub-folders.Following internal features are available for a folder:
collapse()
: Collapse the folder.expand()
: Expand the folder.getChild(String)
: Returns the given child folder.getChildren()
: Returns the folder's children.selectFolder(String)
: Selects the given folder. The full folder path must be
specified to access the sub-folders.
Constructor Summary | |
---|---|
WebFolderElement(WebPage page,
org.openqa.selenium.By elementBy,
org.openqa.selenium.By expandBy,
org.openqa.selenium.By expansionBy,
org.openqa.selenium.By containerBy)
|
|
WebFolderElement(WebPage page,
org.openqa.selenium.By elementBy,
org.openqa.selenium.By expandBy,
org.openqa.selenium.By expansionBy,
org.openqa.selenium.By containerBy,
WebFolderElement parentFolder)
|
|
WebFolderElement(WebPage page,
WebBrowserElement element,
org.openqa.selenium.By expandBy,
org.openqa.selenium.By expansionBy,
org.openqa.selenium.By containerBy)
|
|
WebFolderElement(WebPage page,
WebBrowserElement element,
org.openqa.selenium.By expandBy,
org.openqa.selenium.By expansionBy,
org.openqa.selenium.By containerBy,
WebFolderElement parentFolder)
|
|
WebFolderElement(WebPage page,
WebBrowserElement element,
WebFolderElement parentFolder)
|
Method Summary | |
---|---|
void |
collapse()
Collapse the folder. |
void |
expand()
Expand the folder. |
WebFolderElement |
findFolder(java.lang.String folder)
Search for a folder name in the tree. |
WebFolderElement |
findFolder(java.lang.String parentName,
java.lang.String folder)
Search for a folder name in the tree relatively to a given parent. |
java.util.List<WebFolderElement> |
getAllLeaves()
Return all leaves of the current folder. |
java.util.List<java.lang.String> |
getAllLeavesPath()
Return path for all leaves of the current folder. |
java.util.List<java.lang.String> |
getAllNodes()
Return all nodes of the current folder. |
java.util.List<java.lang.String> |
getAllPaths()
Deprecated. Since 5.0.1, use getAllLeavesPath() instead. |
java.util.List<WebFolderElement> |
getChildren()
Returns the folder's children. |
java.util.List<java.lang.String> |
getChildrenNodes()
Return children nodes of the current folder. |
WebFolderElement |
getFolder(java.lang.String folderPath)
Gets the sub-folder for the given path. |
java.lang.String |
getPath()
Returns the path of the current folder. |
java.lang.String |
getText()
Return the text of the expandable element. |
WebFolderElement |
searchFolder(java.lang.String folder)
Searches the folder with the given name in the hierarchy starting from current folder. |
void |
select()
Select the folder. |
WebFolderElement |
selectFolder(java.lang.String folderPath)
Selects the sub-folder for the given path. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WebFolderElement(WebPage page, org.openqa.selenium.By elementBy, org.openqa.selenium.By expandBy, org.openqa.selenium.By expansionBy, org.openqa.selenium.By containerBy)
public WebFolderElement(WebPage page, org.openqa.selenium.By elementBy, org.openqa.selenium.By expandBy, org.openqa.selenium.By expansionBy, org.openqa.selenium.By containerBy, WebFolderElement parentFolder)
public WebFolderElement(WebPage page, WebBrowserElement element, org.openqa.selenium.By expandBy, org.openqa.selenium.By expansionBy, org.openqa.selenium.By containerBy)
public WebFolderElement(WebPage page, WebBrowserElement element, org.openqa.selenium.By expandBy, org.openqa.selenium.By expansionBy, org.openqa.selenium.By containerBy, WebFolderElement parentFolder)
public WebFolderElement(WebPage page, WebBrowserElement element, WebFolderElement parentFolder)
Method Detail |
---|
public void collapse()
public void expand()
public WebFolderElement findFolder(java.lang.String folder)
The search is performed depth first.
Note that if there are several folders with the same name, then first found is returned.
folder
- Name of the child folder to search
WebFolderElement
or
null
if current folder has no child with the given name.public WebFolderElement findFolder(java.lang.String parentName, java.lang.String folder)
The search is performed depth first.
Note that if there are several folders with the same name, then first found is returned.
parentName
- Name of the parent folder. Can be null
.folder
- Name of the child folder to search
WebFolderElement
or
null
if current folder has no child with the given name.public java.util.List<WebFolderElement> getAllLeaves()
List
of WebFolderElement
.public java.util.List<java.lang.String> getAllLeavesPath()
List
of String
.public java.util.List<java.lang.String> getAllNodes()
List
of String
.@Deprecated public java.util.List<java.lang.String> getAllPaths()
getAllLeavesPath()
instead.
List
of String
.public final java.util.List<WebFolderElement> getChildren()
List
of WebFolderElement
.public java.util.List<java.lang.String> getChildrenNodes()
List
of String
.public WebFolderElement getFolder(java.lang.String folderPath)
For example, "JKE Banking/JKE Enterprise Project/Business Goals" accesses the Business Goals sub-sub-folder. To access the top folder or project folder just enter the folder name, ex. "JKE Banking".
folderPath
- The folder path. Might be a simple name or a fully-qualified
path using '/' character for segment delimiter.
WebFolderElement
or
null
if no folder was not found for the given folder path.public java.lang.String getPath()
The path is made of all containing folders texts separated by /'s plus the folder text (e.g. "/Custom Reports/Sample Report Definitions/CCM").
TODO: It seems to be a really costly operation, needs to be improved...
public java.lang.String getText()
Overrides to return the text of the expandable element.
getText
in class WebElementWrapper
String
.public WebFolderElement searchFolder(java.lang.String folder)
There's no indication if the returned folder is the unique one with the given name in the hierarchy, as the first matching folder (deepest first) is returned.
folder
- The folder to search in the hierarchy. That might be either a name
or a path (absolute or relative).
WebFolderElement
or null
if none was found.public void select()
public WebFolderElement selectFolder(java.lang.String folderPath) throws ScenarioFailedError
If path has several segments, then the search occurs recursively through sub-folders levels to match each segment of the given path.
For example, "JKE Banking/JKE Enterprise Project/Business Goals" accesses the Business Goals sub-folder. To access the top folder or project folder just enter the folder name, ex. "JKE Banking".
folderPath
- The folder path. Might be a simple name or a fully-qualified
path using '/' character for segment delimiter.
WebFolderElement
.
ScenarioFailedError
- if no folder was not found for the given folder path.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |