Class Grid

  • All Implemented Interfaces:
    org.openqa.selenium.interactions.Locatable, org.openqa.selenium.SearchContext, org.openqa.selenium.TakesScreenshot, org.openqa.selenium.WebElement, org.openqa.selenium.WrapsDriver

    public class Grid
    extends DesktopElement
    • Constructor Detail

      • Grid

        public Grid​(org.openqa.selenium.WebElement element)
    • Method Detail

      • rowCount

        public int rowCount()
        Gets the total row count.
      • columnCount

        public int columnCount()
        Gets the total column count.
      • columnHeaders

        public List<org.openqa.selenium.remote.RemoteWebElement> columnHeaders()
        Gets all column header elements.
      • rowHeaders

        public List<org.openqa.selenium.remote.RemoteWebElement> rowHeaders()
        Gets all row header elements.
      • rowOrColumnMajor

        public RowOrColumnMajor rowOrColumnMajor()
        Gets whether the data should be read primarily by row or by column.
      • getHeader

        public GridHeader getHeader()
        Gets the header item.
      • getRows

        public List<GridRow> getRows()
        Returns the rows which are currently visible to UIA. Might not be the full list (eg. in virtualized lists)!
      • selectedItems

        public List<GridRow> selectedItems()
        Gets all selected items.
      • selectedItem

        public GridRow selectedItem()
        Gets the first selected item or null otherwise.
      • select

        public GridRow select​(int rowIndex)
        Select a row by index.
        Parameters:
        rowIndex -
        Returns:
      • select

        public GridRow select​(int columnIndex,
                              String textToFind)
        Select the first row by text in the given column.
        Parameters:
        columnIndex -
        textToFind -
        Returns:
      • addToSelection

        public GridRow addToSelection​(int rowIndex)
        Add a row to the selection by index.
        Parameters:
        rowIndex -
        Returns:
      • addToSelection

        public GridRow addToSelection​(int columnIndex,
                                      String textToFind)
        Add a row to the selection by text in the given column.
        Parameters:
        columnIndex -
        textToFind -
        Returns:
      • removeFromSelection

        public GridRow removeFromSelection​(int rowIndex)
        Remove a row from the selection by index.
        Parameters:
        rowIndex -
        Returns:
      • removeFromSelection

        public GridRow removeFromSelection​(int columnIndex,
                                           String textToFind)
        Remove a row from the selection by text in the given column.
        Parameters:
        columnIndex -
        textToFind -
        Returns:
      • getRowByIndex

        public GridRow getRowByIndex​(int rowIndex)
        Get a row by index.
        Parameters:
        rowIndex -
        Returns:
      • getRowByValue

        public GridRow getRowByValue​(int columnIndex,
                                     String textToFind)
        Get a row by text in the given column.
        Parameters:
        columnIndex -
        textToFind -
        Returns:
      • getRowsByValue

        public List<GridRow> getRowsByValue​(int columnIndex,
                                            String value,
                                            int maxItems)
        Get all rows where the value of the given column matches the given value.
        Parameters:
        columnIndex - The column index to check.
        value - The value to check.
        maxItems - Maximum numbers of items to return, 0 for all.
        Returns:
        List of found rows.