Open topic with navigation

com.hp.lft.sdk.web

## Interface GridBase<T extends TableRowBase>

Note: Supported in LeanFT versions 14.51 and later.

- Type Parameters:
    `T` - the specified table row.
  All Superinterfaces:
    Clickable, LocationInfoProvider, SupportDragAndDrop, SupportsNativeObject, TestObject, TestObjectDescriber, VisibleProvider, WaitUntilVisibleProvider, WebElement, WebTestObject, WebTestObjectDescriber
  All Known Subinterfaces:
    AgGrid, UiGrid

      public interface GridBase<T extends TableRowBase>
      extends WebElement

  Base interface for Web grid test objects.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `findRowWithCellTextInColumn(String text, int columnNumber)` Finds the first row with the specified text in the specified column.
    `T` | `findRowWithCellTextInColumn(String text, int columnNumber, int startFromRow)` Finds the first row with the specified text in the specified column, starting from the specified row.
    `T` | `findRowWithCellTextInColumn(String text, String columnHeader)` Finds the first row with the specified text in the specified column.
    `T` | `findRowWithCellTextInColumn(String text, String columnHeader, int startFromRow)` Finds the first row with the specified text in the specified column, starting from the specified row.
    `T` | `findRowWithCellTextInColumn(TextMatch textMatch, ColumnToSearch columnToSearch)` Finds the row with the specified text in the specified column, in cases where the text or columnHeader may appear more than once.
    `List<String>` | `getColumnHeaders()` Returns the headers of the columns, usually this is the text of the first row.
    `List<T>` | `getRows()` Returns a collection of rows.
    `void` | `selectCell(int row, int column)` Selects the specified cell in the grid.
    `void` | `selectCell(int row, String columnHeader)` Selects the specified cell in the grid.

    - ### 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.WaitUntilVisibleProvider

      `waitUntilVisible, waitUntilVisible`

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

      `dragAndDropOn, dragAndDropOn`

- - ### Method Detail

    - #### getColumnHeaders

                                                      List<String> getColumnHeaders()
                            throws GeneralLeanFtException

      Returns the headers of the columns, usually this is the text of the first row.
      Returns:
        the headers of the columns, usually this is the text of the first row.
      Throws:
        `GeneralLeanFtException` - if error occurs during execution

    - #### getRows

                                                      List<T> getRows()
                                               throws GeneralLeanFtException

      Returns a collection of rows.
      Returns:
        a collection of rows.
      Throws:
        `GeneralLeanFtException` - if error occurs during execution

    - #### selectCell

          void selectCell(int row,
                        int column)
                          throws GeneralLeanFtException

      Selects the specified cell in the grid.
      Parameters:
        `row` - 0-based row index
        `column` - 0-based column index
      Throws:
        `GeneralLeanFtException` - if error occurs during execution

    - #### selectCell

          void selectCell(int row,
                        String columnHeader)
                          throws GeneralLeanFtException

      Selects the specified cell in the grid.
      Parameters:
        `row` - 0-based row index
        `columnHeader` - the column caption
      Throws:
        `GeneralLeanFtException` - if error occurs during execution

    - #### findRowWithCellTextInColumn

                                                      T findRowWithCellTextInColumn(String text,
                                      int columnNumber)
                                                             throws GeneralLeanFtException

      Finds the first row with the specified text in the specified column.
      Parameters:
        `text` - the text to find.
        `columnNumber` - the column number to search.
      Returns:
        the requested row or null if non exists.
      Throws:
        `GeneralLeanFtException` - if error occurs during execution

    - #### findRowWithCellTextInColumn

                                                      T findRowWithCellTextInColumn(String text,
                                      String columnHeader)
                                                             throws GeneralLeanFtException

      Finds the first row with the specified text in the specified column.
      Parameters:
        `text` - the text to find.
        `columnHeader` - the column caption.
      Returns:
        the requested row or null if none exists.
      Throws:
        `GeneralLeanFtException` - if error occurs during execution

    - #### findRowWithCellTextInColumn

                                                      T findRowWithCellTextInColumn(String text,
                                      int columnNumber,
                                      int startFromRow)
                                                             throws GeneralLeanFtException

      Finds the first row with the specified text in the specified column, starting from the specified row.
      Parameters:
        `text` - text to find.
        `columnNumber` - the column number to search.
        `startFromRow` - index from which to start the search.
      Returns:
        the requested row, or null if none exists.
      Throws:
        `GeneralLeanFtException` - if error occurs during execution

    - #### findRowWithCellTextInColumn

                                                      T findRowWithCellTextInColumn(String text,
                                      String columnHeader,
                                      int startFromRow)
                                                             throws GeneralLeanFtException

      Finds the first row with the specified text in the specified column, starting from the specified row.
      Parameters:
        `text` - text to find.
        `columnHeader` - the column caption.
        `startFromRow` - index from which to start the search.
      Returns:
        the requested row, or null if none exists.
      Throws:
        `GeneralLeanFtException` - if error occurs during execution

    - #### findRowWithCellTextInColumn

                                                      T findRowWithCellTextInColumn(TextMatch textMatch,
                                      ColumnToSearch columnToSearch)
                                                             throws GeneralLeanFtException

      Finds the row with the specified text in the specified column, in cases where the text or columnHeader may appear more than once. Scrolls to the found row if one exists.
      Usage example: TableRow row = grid.findRowWithCellTextInColumn(TextMatch.match("Portuguese", 2), ColumnToSearch.byHeader("Language", 1));
      This example finds the 3rd occurrence of the text "Portuguese" in the 2nd column with the header "Language".
      Parameters:
        `textMatch` - description of the text we are looking for
        `columnToSearch` - the column number or column header in which to search for the text.
      Returns:
        the requested row if one exists.
      Throws:
        `GeneralLeanFtException` - if the requested row cannot be found or error occurs during execution