Class TableCellElement

java.lang.Object
com.vaadin.testbench.TestBenchElement
com.vaadin.flow.component.html.testbench.TableCellElement
All Implemented Interfaces:
com.vaadin.testbench.commands.CanCompareScreenshots, com.vaadin.testbench.HasCallFunction, com.vaadin.testbench.HasDriver, com.vaadin.testbench.HasElementQuery, com.vaadin.testbench.HasPropertySettersGetters, com.vaadin.testbench.HasSearchContext, com.vaadin.testbench.HasTestBenchCommandExecutor, org.openqa.selenium.SearchContext, org.openqa.selenium.TakesScreenshot, org.openqa.selenium.WebElement, org.openqa.selenium.WrapsElement
Direct Known Subclasses:
TableDataCellElement, TableHeaderCellElement

public class TableCellElement extends com.vaadin.testbench.TestBenchElement
A TestBench element representing either kind of table cell, a <td> or a <th>. It carries no @Element annotation of its own: it is the type TableRowElement.getCells() speaks in when the kind of cell does not matter, mirroring TableCell on the component side.
Since:
25.3
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the colspan of this cell, or 1 if it carries none.
    int
    Returns how many rows this cell actually covers, which is what getRowspan() says only when the cell neither uses 0 nor reaches past the end of its row group.
    int
    Returns the rowspan of this cell as written, or 1 if it carries none.

    Methods inherited from class com.vaadin.testbench.TestBenchElement

    callFunction, clear, click, click, compareScreen, compareScreen, compareScreen, contextClick, dispatchEvent, dispatchEvent, doubleClick, equals, executeScript, findElement, findElements, focus, getAttribute, getCapabilities, getChildren, getClassNames, getCommandExecutor, getContext, getCssValue, getDomAttribute, getDomProperty, getDriver, getId, getLocation, getParent, getProperty, getPropertyBoolean, getPropertyDouble, getPropertyElement, getPropertyElements, getPropertyInteger, getPropertyString, getRect, getScreenshotAs, getShadowRoot, getSize, getTagName, getText, getWrappedElement, hasAttribute, hasClassName, hashCode, hover, init, init, isChrome, isDisplayed, isEnabled, isFirefox, isFocused, isReadOnly, isSelected, scroll, scrollIntoView, scrollIntoView, scrollLeft, sendKeys, setProperty, setProperty, setProperty, setProperty, submit, waitForVaadin, waitUntil, waitUntil, wrap, wrapElement, wrapElements

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.testbench.HasElementQuery

    $, $

    Methods inherited from interface org.openqa.selenium.WebElement

    getAccessibleName, getAriaRole
  • Constructor Details

    • TableCellElement

      public TableCellElement()
  • Method Details

    • getColspan

      public int getColspan()
      Returns the colspan of this cell, or 1 if it carries none. The value comes from the DOM property, so the browser has already applied the rules: an absent, negative or unparseable colspan reads as 1, and so does 0, that value having been dropped from HTML.
      Returns:
      the number of columns this cell covers, at least 1.
    • getRowspan

      public int getRowspan()
      Returns the rowspan of this cell as written, or 1 if it carries none. The value comes from the DOM property, so an absent, negative or unparseable rowspan reads as 1 — but 0 is kept, since it is meaningful in HTML and means the cell reaches to the end of its row group. Use getResolvedRowspan() for the number of rows that works out to.
      Returns:
      the rowspan of this cell, where 0 means to the end of the row group.
    • getResolvedRowspan

      public int getResolvedRowspan()
      Returns how many rows this cell actually covers, which is what getRowspan() says only when the cell neither uses 0 nor reaches past the end of its row group. A rowspan of 0 resolves to the number of rows left in the <thead>, <tbody> or <tfoot> holding the cell, and a span longer than that group is cut off at its end, because a row span may not cross from one row group into the next.

      There is no counterpart for colspan: 0 is not a legal value for it, so getColspan() is already the number of columns covered.

      Returns:
      the number of rows this cell covers, at least 1.