Open topic with navigation

com.hp.lft.sdk.web

## Interface Menu

- All Superinterfaces:
    Clickable, LocationInfoProvider, SupportDragAndDrop, SupportsNativeObject, TestObject, TestObjectDescriber, VisibleProvider, WaitUntilVisibleProvider, WebElement, WebTestObject, WebTestObjectDescriber

      public interface Menu
      extends WebElement

  A menu control in a Web page or application.

- - ### Method Summary

    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `buildMenuPath(java.lang.Object... menuPathParts)` Returns the path of the specified menu item.
    `java.util.List<java.lang.String>` | `getTopLevelMenuItems()` Returns the list of all the top level menu items contained in this menu.
    `void` | `select(java.lang.Object... menuPathParts)` Selects the specified item in the menu by path.
    `void` | `select(java.lang.String menuPath)` Selects the specified item in the menu by path.

    - ### Methods inherited from interface com.hp.lft.sdk.web.WebElement

      `doubleClick, doubleClick, fireEvent, getAccessibilityName, getCSSSelector, getRole, getXPath, hoverTap, hoverTap, longPress, longPress, pan, pan, pinch, pinch, swipe, swipe`

    - ### Methods inherited from interface com.hp.lft.sdk.TestObject

      `exists, exists, findChildren, getDescription, getDisplayName, getParent, getSnapshot, getTextLocations, getTextLocations, getVisibleText, getVisibleText, highlight, highlightMatches, setDescription, setDisplayName, verifyImageExists, verifyImageExists, verifyImageMatch, verifyImageMatch, verifyImageMatch, verifyImageMatch, verifyImageMatch, verifyImageMatch, waitUntilExists, waitUntilExists`

    - ### Methods inherited from interface com.hp.lft.sdk.Clickable

      `click, click, click`

    - ### Methods inherited from interface com.hp.lft.sdk.web.WebTestObject

      `getAttribute, getAttributes, getClassName, getComputedStyle, getComputedStyles, getId, getInnerHTML, getInnerText, getName, getOuterHTML, getOuterText, getTagName, getTitle, isVisible`

    - ### Methods inherited from interface com.hp.lft.sdk.LocationInfoProvider

      `getAbsoluteLocation, getLocation, getSize`

    - ### Methods inherited from interface com.hp.lft.sdk.web.WebTestObjectDescriber

      `describe, describe`

    - ### Methods inherited from interface com.hp.lft.sdk.TestObjectDescriber

      `describe`

    - ### Methods inherited from interface com.hp.lft.sdk.SupportsNativeObject

      `getNativeObject`

    - ### Methods inherited from interface com.hp.lft.sdk.SupportDragAndDrop

      `dragAndDropOn, dragAndDropOn`

    - ### Methods inherited from interface com.hp.lft.sdk.WaitUntilVisibleProvider

      `waitUntilVisible, waitUntilVisible`

    - ### Methods inherited from interface com.hp.lft.sdk.VisibleProvider

      `isVisible`

- - ### Method Detail

    - #### buildMenuPath

          java.lang.String buildMenuPath(java.lang.Object... menuPathParts)

      Returns the path of the specified menu item.
      Parameters:
        `menuPathParts` - the menu path parts can be: logical name(string), full path(string), or numeric index(int).
        Index values are 0-based. For a full path, separate items with commas.
      Returns:
        the menu path

    - #### getTopLevelMenuItems

          java.util.List<java.lang.String> getTopLevelMenuItems()
                                                         throws GeneralLeanFtException

      Returns the list of all the top level menu items contained in this menu.
      Returns:
        An array of strings containing the top level menu items in this menu.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### select

          void select(java.lang.String menuPath)
               throws GeneralLeanFtException

      Selects the specified item in the menu by path.
      Parameters:
        `menuPath` - the full path of the menu item to return. To specify the index of the item to select, use #Number where Number is the item number.
        Index values begin with 0.
        Tip: Use the BuildMenuPath method to build the menu path string to be used as the menuPath argument for this method
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### select

          void select(java.lang.Object... menuPathParts)
               throws GeneralLeanFtException

      Selects the specified item in the menu by path.
      Parameters:
        `menuPathParts` - the menu path parts can be: logical name(string), full path(string), or numeric index(int).
        Index values are 0-based. For a full path, separate items with commas.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.