Class TdBy


  • public final class TdBy
    extends Object

    A set of methods to be used when looking for fields value in a table. This mechanism used to locate elements within a document using a single lookup. It converts row number and column number into search objects and returns By object with results.

    Since:
    0.1
    Author:
    Nir Gallner
    See Also:
    ByAll, AnyBy, ElementBy, InputBy, AllBy, NotBy
    • Method Detail

      • cellLocation

        public static org.openqa.selenium.By cellLocation​(int rowNumber,
                                                          int columnNumber)
        Looks for a cell value with rowNumber and columnNumber.
        For example:
        with the following table:
        Month Savings
        Sum $180
        January $100
        February $80


        The code WebElement element = driver.findElement(TdBy.cellLocation(1,0));
        will return the value "January"
        Parameters:
        rowNumber - row number to look for. First row is 0
        columnNumber - col number to look for. First col is 0
        Returns:
        By object with the locators ready in it
      • tableHeader

        public static org.openqa.selenium.By tableHeader​(int columnNumber)
        Looks for a header valuewith a specific columnNumber.
        For example:
        with the following table:
        Month Savings
        Sum $180
        January $100
        February $80
        The code WebElement element = driver.findElement(TdBy.tableHeader(0));
        will return the value "Month"
        Parameters:
        columnNumber - col number to look for. First col is 0.
        Returns:
        By object with the locators ready in it