public class GridElement
extends com.vaadin.testbench.TestBenchElement
<vaadin-grid> element.| Constructor and Description |
|---|
GridElement() |
| Modifier and Type | Method and Description |
|---|---|
void |
deselect(int rowIndex)
Deselects the row with the given index.
|
List<org.openqa.selenium.WebElement> |
findInShadowRoot(org.openqa.selenium.By by)
Deprecated.
this method will not working for Chrome 96+, because of the
breaking changes in ChromeDriver.
|
protected void |
generatedColumnIdsIfNeeded() |
List<GridColumnElement> |
getAllColumns()
Gets all columns defined for the grid, including any selection checkbox
column.
|
GridTHTDElement |
getCell(int rowIndex,
GridColumnElement column)
Gets the grid cell for the given row and column.
|
GridTHTDElement |
getCell(int rowIndex,
int colIndex)
Gets the grid cell for the given row and column index.
|
GridTHTDElement |
getCell(String contents)
Finds the first cell inside the rendered range with a text content
matching the given string.
|
List<GridTHTDElement> |
getCells(int rowIndex)
Gets the grid cells for the given row.
|
List<GridTHTDElement> |
getCells(int rowIndex,
GridColumnElement... columnElements)
Gets the grid cells for the given row and column elements.
|
GridColumnElement |
getColumn(String headerText)
Gets the column with the given header text.
|
int |
getFirstVisibleRowIndex()
Gets the index of the first row which is at least partially visible.
|
GridTHTDElement |
getFooterCell(int columnIndex)
Gets the footer cell for the given visible column index.
|
GridTHTDElement |
getHeaderCell(int columnIndex)
Gets the header cell for the given visible column index.
|
com.vaadin.testbench.TestBenchElement |
getHeaderCellContent(int rowIndex,
int columnIndex)
Finds the vaadin-grid-cell-content element for the given row and column
in header.
|
int |
getLastVisibleRowIndex()
Gets the index of the last row which is at least partially visible.
|
int |
getPageSize()
Gets the page size used when fetching data.
|
GridTRElement |
getRow(int rowIndex)
Gets the
tr element for the given row index. |
int |
getRowCount()
Gets the total number of rows.
|
List<GridTRElement> |
getRows(int firstRowIndex,
int lastRowIndex)
Gets the rows (present in the DOM) specified by the lower and upper row
indexes.
|
List<GridColumnElement> |
getVisibleColumns()
Gets the currently visible columns in the grid, including any selection
checkbox column.
|
List<GridTRElement> |
getVisibleRows()
Gets all the currently visible rows.
|
protected boolean |
isLoading() |
void |
scrollToRow(int row)
Scrolls to the row with the given index.
|
void |
select(int rowIndex)
Selects the row with the given index.
|
protected void |
waitUntilLoadingFinished() |
callFunction, clear, click, click, compareScreen, compareScreen, compareScreen, contextClick, dispatchEvent, dispatchEvent, doubleClick, equals, executeScript, findElement, findElements, focus, getAttribute, getCapabilities, getClassNames, getCommandExecutor, getContext, getCssValue, getDriver, getLocation, getProperty, getPropertyBoolean, getPropertyDouble, getPropertyElement, getPropertyElements, getPropertyInteger, getPropertyString, getRect, getScreenshotAs, getSize, getTagName, getText, getWrappedElement, hasAttribute, hasClassName, hashCode, init, init, isChrome, isDisplayed, isEnabled, isFirefox, isIE, isSelected, scroll, scrollIntoView, scrollLeft, sendKeys, setProperty, setProperty, setProperty, setProperty, submit, waitForVaadin, waitUntil, waitUntil, wrap, wrapElement, wrapElementsprotected void waitUntilLoadingFinished()
protected boolean isLoading()
public void scrollToRow(int row)
row - the row to scroll topublic int getPageSize()
public int getFirstVisibleRowIndex()
public int getRowCount()
public GridTHTDElement getCell(int rowIndex, int colIndex)
For the column index, only visible columns are taken into account.
Automatically scrolls the given row into view
rowIndex - the row indexcolIndex - the column indexpublic GridTHTDElement getCell(int rowIndex, GridColumnElement column)
Automatically scrolls the given row into view
rowIndex - the row indexcolumn - the column element for the columnpublic GridTHTDElement getCell(String contents) throws org.openqa.selenium.NoSuchElementException
contents - the string to look fororg.openqa.selenium.NoSuchElementException - if no cell with the given string was foundpublic int getLastVisibleRowIndex()
public List<GridTRElement> getRows(int firstRowIndex, int lastRowIndex) throws IndexOutOfBoundsException
firstRowIndex - the lower row index to be retrieved (inclusive)lastRowIndex - the upper row index to be retrieved (inclusive)GridTRElement list with the rows contained between the
given coordinates.IndexOutOfBoundsException - if either of the provided row indexes do not existpublic GridTRElement getRow(int rowIndex)
tr element for the given row index.rowIndex - the row indexpublic List<GridColumnElement> getAllColumns()
protected void generatedColumnIdsIfNeeded()
public List<GridColumnElement> getVisibleColumns()
public GridColumnElement getColumn(String headerText) throws org.openqa.selenium.NoSuchElementException
If multiple columns are found with the same header text, returns the first column.
headerText - the text in the headerorg.openqa.selenium.NoSuchElementException - if no column was foundpublic GridTHTDElement getHeaderCell(int columnIndex)
columnIndex - the index of the columnpublic com.vaadin.testbench.TestBenchElement getHeaderCellContent(int rowIndex,
int columnIndex)
rowIndex - the index of the row in the headercolumnIndex - the index of the column in the header@Deprecated public List<org.openqa.selenium.WebElement> findInShadowRoot(org.openqa.selenium.By by)
WebElements using the given By selector.by - the selector used to find elementspublic GridTHTDElement getFooterCell(int columnIndex)
columnIndex - the index of the columnpublic void select(int rowIndex)
rowIndex - the row to selectpublic void deselect(int rowIndex)
rowIndex - the row to deselectpublic List<GridTRElement> getVisibleRows()
GridTRElement list representing the currently visible
rows.public List<GridTHTDElement> getCells(int rowIndex, GridColumnElement... columnElements)
rowIndex - the row indexcolumnElements - the column elementsGridTHTDElement list with the cells for the given
coordinates.public List<GridTHTDElement> getCells(int rowIndex)
rowIndex - the row indexGridTHTDElement list with the cells for the given
coordinates.Copyright © 2025. All rights reserved.