This is a migrated thread and some comments may be shown as answers.

Handling GridView operations with UIAutomation

1 Answer 268 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Raphael
Top achievements
Rank 1
Raphael asked on 03 Sep 2020, 04:06 PM

We are currently setting up some tests with Microsofts UI Automation.

For my next steps I'm searching for a way to implement selection for GridView rows.
So far I couldn't really find any documentations how to deal with this with Telerik controls in detail.

Currently I access the grid, grid row and grid row cells as follows:

AutomationElement radGridView = Element.TryFindId (OrderConstants.ORDER_GRID_ID);
AutomationElementCollection orderRowElements = radGridView.FindAll (
                TreeScope.Descendants,
                new PropertyCondition (AutomationElement.ClassNameProperty, "GridViewRow"));
 
int rowId = 0;
foreach (AutomationElement orderRowElement in orderRowElements)
{
    ((SelectionItemPattern) orderRowElement.GetCurrentPattern(SelectionItemPattern.Pattern)).Select() // Is Not Supported Pattern
 
    AutomationElement elem = orderRowElement.TryFindId ($"Cell_{rowId++}_0");
    ((SelectionItemPattern) elem.GetCurrentPattern(SelectionItemPattern.Pattern)).Select() // Is Not Supported Pattern
}

 

How can I select

  • a single row
  • multiple rows
  • search within the grid (because it looks like rows are not available before they are processed by virtualization of the grid)

How is the RadGridView intended to be used in a automated way?

Currently I'm using .Net Framework 4 with Telerik Version 2018.3

 

Any help is appreciated, thanks.

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 08 Sep 2020, 02:25 PM

Hello Raphael,

There was an issue similar to this in RadGridView and RadTreeListView. This was resolved with a release from this year. You can download the latest release and see if the issue still occurs.

Also, you can give the Telerik Testing Framework, which is free, a try. The framework comes with wrappers for the Telerik WPF components so you don’t need to map all the small controls, items and properties in your project. You can check the help documentation to see how the Testing Framework is used.

Regards,
Martin Ivanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
GridView
Asked by
Raphael
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or