Grid
flaui.core.automation_elements.Grid
Bases: AutomationElement
Element for grids and tables
column_count
property
Gets the total column count.
Returns:
| Type | Description |
|---|---|
int
|
Column Count |
column_headers
property
Gets all column header elements.
Returns:
| Type | Description |
|---|---|
List[AutomationElement]
|
List of column header elements |
header
property
Gets the header item.
Returns:
| Type | Description |
|---|---|
GridHeader
|
Header item |
row_count
property
Gets the total row count.
Returns:
| Type | Description |
|---|---|
int
|
Row Count |
row_headers
property
Gets all row header elements.
Returns:
| Type | Description |
|---|---|
List[AutomationElement]
|
List of row header elements |
row_or_column_major
property
Gets whether the data should be read primarily by row or by column.
Returns:
| Type | Description |
|---|---|
RowOrColumnMajor
|
Row/Column |
rows
property
Returns the rows which are currently visible to UIA. Might not be the full list (eg. in virtualized lists)! /// Use "GetRowByIndex" to make sure to get the correct row.
Returns:
| Type | Description |
|---|---|
List[GridRow]
|
List of GridRow elements |
selected_item
property
Gets the first selected item or null otherwise.
Returns:
| Type | Description |
|---|---|
GridRow
|
GridRow element if selected, else None |
selected_items
property
Gets all selected items.
Returns:
| Type | Description |
|---|---|
List[GridRow]
|
List of GridRow elements |
add_to_selection(row_index=None, column_index=None, text_to_find=None)
Add a row to the selection by index or by text in the given column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
row_index
|
Optional[int]
|
Row index |
None
|
column_index
|
Optional[int]
|
Column index |
None
|
text_to_find
|
Optional[str]
|
Text to find in the column |
None
|
Returns:
| Type | Description |
|---|---|
GridRow
|
GridRow element |
Raises:
| Type | Description |
|---|---|
ValueError
|
On invalid input combination |
Source code in flaui/core/automation_elements.py
get_row_by_index(row_index)
a row by index.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
row_index
|
int
|
Row index |
required |
Returns:
| Type | Description |
|---|---|
GridRow
|
GridRow element |
Source code in flaui/core/automation_elements.py
get_row_by_value(column_index, value)
Get a row by text in the given column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
column_index
|
int
|
Column index |
required |
value
|
str
|
Value |
required |
Returns:
| Type | Description |
|---|---|
GridRow
|
GridRow element |
Source code in flaui/core/automation_elements.py
get_rows_by_value(column_index, value, max_items=0)
Get all rows where the value of the given column matches the given value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
column_index
|
int
|
The column index to check. |
required |
value
|
str
|
The value to check. |
required |
max_items
|
int
|
Maximum numbers of items to return, 0 for all, defaults to 0 |
0
|
Returns:
| Type | Description |
|---|---|
List[GridRow]
|
List of found rows as GridRow elements. |
Source code in flaui/core/automation_elements.py
remove_from_selection(row_index=None, column_index=None, text_to_find=None)
Remove a row to the selection by index or by text in the given column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
row_index
|
Optional[int]
|
Row index |
None
|
column_index
|
Optional[int]
|
Column index |
None
|
text_to_find
|
Optional[str]
|
Text to find in the column |
None
|
Returns:
| Type | Description |
|---|---|
GridRow
|
GridRow element |
Raises:
| Type | Description |
|---|---|
ValueError
|
On invalid input combination |
Source code in flaui/core/automation_elements.py
select(row_index=None, column_index=None, text_to_find=None)
Select the first row by text in the given Row index or a combination of Column index along with text_to_find.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
row_index
|
Optional[int]
|
Row index |
None
|
column_index
|
Optional[int]
|
Column index |
None
|
text_to_find
|
Optional[str]
|
Text to find in the column |
None
|
Returns:
| Type | Description |
|---|---|
GridRow
|
GridRow element |
Raises:
| Type | Description |
|---|---|
ValueError
|
On invalid input combination |