Automated testing support for FlexGrid .Net5 datagrid -- missing row presenters

Posted by: arajendran on 17 November 2021, 7:56 am EST

  • Posted 17 November 2021, 7:56 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!
  • Replied 17 November 2021, 4:10 pm EST

    Hello,

    Thanks for the code snippet and snapshots.

    JFYI, Flexgrid .Net 5 and C1DataGrid have different design architectures. i.e., DataGrid works with RowPresenters and Flexgrid .Net 5 uses CellFactory to display the CellView.

    So, sorry to inform you that, this is the design behavior of Flexgrid .Net 5. Hence it is not possible for .Net 5 Flexgrid to get RowPresenter.

    Best Regards.
    Nitin
  • Replied 18 November 2021, 3:59 am EST

    Thanks for the quick response. What is the new pattern for interacting with the FlexGrid with coded UI? Are there examples I can take a look at?

    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");
    // This returns the cells panel
    DataGridCells = PaneOrView.FindElementsByClassName("GridCellsPanel");
    }

    public AppiumWebElement GetRowByIndex(int rowIndex)
    {
    // What code would I use to do this?
    }

    public AppiumWebElement GetCell<T>(int rowIndex, T columnNameOrIndex) where T : IConvertible
    {
    // How can I find a cell without using a row index?
    }
    }


    Most of our functions are dependent on GetRowByIndex() and then GetCell(). Subsequent actions are managed by our codedui framework.
  • Replied 21 November 2021, 10:15 pm EST

    Hi,

    Sorry for the delay, but we're discussing this to the development team. We'll get back to you once we have any update. [Internal Tracking Id - C1XAML-28446]

    Regards,
    Nitin
  • Replied 23 November 2021, 2:56 pm EST

    Hello,

    As per development team, full support of automation patterns with selecting rows, columns or cells is still in our to-do list.
    So, sorry to inform you that currently it is not supported in .NET 5 controls. We will try to address it in 2022v1.

    We'll let you know when the support is available.

    Best Regards,
    Nitin
  • Marked as Answer

    Replied 31 March 2022, 10:19 pm EST

    Hi,

    We are happy to inform you that this issue has been fixed with the latest build 2022v1.
    So, we would request you to upgrade to the latest build using ComponentOne control panel. Just in case if you don't have ComponentOne Control Panel, you can download it from https://www.grapecity.com/componentone/download.

    Best Regards,
    Nitin
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels