Posted 17 November 2021, 4:56 pm EST - Updated 4 October 2022, 8:32 am EST
We are moving from the Component1 grid to the FlexGrid .Net5 datagrid and we’ve run into issues updating our UI automated tests. There are no row presenters anymore. Right now, the UI map shows a flat collection of cells.
Some of our initialization code:
public TableView(Application application = null, int index = 0) : base(application, PaneOrViewType.TableView, index)
{
Table = PaneOrView.FindElementByAccessibilityId("_tableControl");
TableToolbar = PaneOrView.FindElementByAccessibilityId("_tableToolbar");
StatusControl = PaneOrView.FindElementByAccessibilityId("_statusControl");
TableGrid = Table.FindElementByClassName("DataGridRowsPanel");
// This returns the datagrid
DataGrid = PaneOrView.FindElementByAccessibilityId("_tableDataGrid");
}
We use the datagrid to get a row by index:
public AppiumWebElement GetRowByIndex(int rowIndex)
{
var selectedRow = DataGrid.VerticalScrollPercent() <= 0.0 ?
DataGrid.FindElementsByClassName("DataGridRowPresenter").ElementAtOrDefault(CorrectedRowIndex(rowIndex))
: null;
Assert.IsNotNull(selectedRow, $"Unable to find row in TableView at index {rowIndex}.");
return selectedRow;
}
This is what the UI map for the C1 grid. You see the rows are returned first:
This is the FlexGrid:
Any help is appreciated. Thanks!