Class TableElement
java.lang.Object
com.vaadin.testbench.TestBenchElement
com.vaadin.flow.component.html.testbench.TableElement
- 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
public class TableElement
extends com.vaadin.testbench.TestBenchElement
A TestBench element representing a
<table> element.- Since:
- 25.3
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns every row of this table, walking its sections in document order.Returns the<tbody>elements of this table, in document order.Returns the rows of this table's<tbody>elements, in document order.Returns this table's caption.getCell(int row, int column) Returns the cell at the given row and column of this table, with the row index running across the sections as ingetAllRows().Returns the column groups of this table, in document order.getFoot()Returns this table's<tfoot>.Returns the rows of this table's<tfoot>.getHead()Returns this table's<thead>.Returns the rows of this table's<thead>.getRow(int index) Returns the row at the given position ingetAllRows(), so the index runs across the sections rather than within one.booleanReports whether this table has a<caption>, without failing if it does not.booleanhasFoot()Reports whether this table has a<tfoot>, without failing if it does not.booleanhasHead()Reports whether this table has a<thead>, without failing if it does not.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, wrapElementsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.testbench.HasElementQuery
$, $Methods inherited from interface org.openqa.selenium.WebElement
getAccessibleName, getAriaRole
-
Constructor Details
-
TableElement
public TableElement()
-
-
Method Details
-
getAllRows
Returns every row of this table, walking its sections in document order. For a table rendered byTablethat is the<thead>rows, then the rows of each<tbody>, then the<tfoot>rows; on a page that writes the sections in some other order, the result follows the markup rather than that order.The name matches
Table.getAllRows(): this is the only row accessor here that spans every kind of section.getHeaderRows(),getBodyRows()andgetFooterRows()each stay within one kind — though a table may have several<tbody>elements, sogetBodyRowsflattens those — andTableSectionElement.getRows()returns the rows of a single element.- Returns:
- all the rows of this table.
-
getRow
Returns the row at the given position ingetAllRows(), so the index runs across the sections rather than within one.- Parameters:
index- the position of the row.- Returns:
- the row at that position.
-
getCell
Returns the cell at the given row and column of this table, with the row index running across the sections as ingetAllRows().- Parameters:
row- the position of the row.column- the position of the cell within that row.- Returns:
- the cell at that position.
-
getHeaderRows
Returns the rows of this table's<thead>.- Returns:
- the header rows, or an empty list if the table has no
<thead>.
-
getBodyRows
Returns the rows of this table's<tbody>elements, in document order. UsegetBodies()to keep them grouped by body.- Returns:
- the body rows, or an empty list if the table has no
<tbody>.
-
getBodies
Returns the<tbody>elements of this table, in document order. A table may have several, each holding its own rows.- Returns:
- the table bodies.
-
getHead
Returns this table's<thead>.- Returns:
- the header section.
- Throws:
org.openqa.selenium.NoSuchElementException- if the table has none. AskhasHead()first to check without failing;getHeaderRows()is not the same question, since an empty<thead>has no rows.
-
hasHead
public boolean hasHead()Reports whether this table has a<thead>, without failing if it does not.- Returns:
trueif the section is present.
-
getFoot
Returns this table's<tfoot>.- Returns:
- the footer section.
- Throws:
org.openqa.selenium.NoSuchElementException- if the table has none. AskhasFoot()first to check without failing;getFooterRows()is not the same question, since an empty<tfoot>has no rows.
-
hasFoot
public boolean hasFoot()Reports whether this table has a<tfoot>, without failing if it does not.- Returns:
trueif the section is present.
-
getCaption
Returns this table's caption.- Returns:
- the
<caption>. - Throws:
org.openqa.selenium.NoSuchElementException- if the table has none. AskhasCaption()first to check without failing.
-
hasCaption
public boolean hasCaption()Reports whether this table has a<caption>, without failing if it does not.- Returns:
trueif the caption is present.
-
getColumnGroups
Returns the column groups of this table, in document order.- Returns:
- the table's
<colgroup>elements.
-