com.ibm.team.fvt.tests.web
Class WebFolderElement

java.lang.Object
  extended by com.ibm.team.fvt.tests.web.WebPageElement
      extended by com.ibm.team.fvt.tests.web.WebElementWrapper
          extended by com.ibm.team.fvt.tests.web.WebFolderElement

public class WebFolderElement
extends WebElementWrapper

Class to handle a folder web element in a web page. A folder may contain multiple folders, which may be several levels deep. The following actions are available on a folder:


Constructor Summary
WebFolderElement(WebPage page, WebBrowserElement element, org.openqa.selenium.By expandBy, org.openqa.selenium.By expansionBy, org.openqa.selenium.By containerBy)
           
 
Method Summary
 void expand()
          Expand the folder.
 java.util.List<WebFolderElement> getChildren()
          Returns the folder's children.
 WebFolderElement getFolder(java.lang.String folderPath)
          Gets the sub-folder for the given path.
 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

WebFolderElement

public WebFolderElement(WebPage page,
                        WebBrowserElement element,
                        org.openqa.selenium.By expandBy,
                        org.openqa.selenium.By expansionBy,
                        org.openqa.selenium.By containerBy)
Method Detail

expand

public void expand()
Expand the folder.


getChildren

public final java.util.List<WebFolderElement> getChildren()
Returns the folder's children.

Returns:
The list of children as a List of WebFolderElement.

getFolder

public WebFolderElement getFolder(java.lang.String folderPath)
Gets the sub-folder for the given path. 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-sub-folder. To access the top folder or project folder just enter the folder name, ex. "JKE Banking".

Parameters:
folderPath - The folder path. Might be a simple name or a fully-qualified path using '/' character for segment delimiter.
Returns:
The selected folder as a WebFolderElement or null if no folder was not found for the given folder path.

select

public void select()
Select the folder.


selectFolder

public WebFolderElement selectFolder(java.lang.String folderPath)
                              throws ScenarioFailedError
Selects the sub-folder for the given path. 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".

Parameters:
folderPath - The folder path. Might be a simple name or a fully-qualified path using '/' character for segment delimiter.
Returns:
The selected folder as a WebFolderElement.
Throws:
ScenarioFailedError - if no folder was not found for the given folder path.