Performance with Infragistics grid

Class library usage, coding and language questions.
schlaup
Posts: 4
Joined: Sat Mar 28, 2009 6:46 pm

Performance with Infragistics grid

Post by schlaup » Sat Mar 28, 2009 7:53 pm

I am trying to select a couple of rows in an Infragistics grid.

The grid has about 10.000 rows and 20 columns and is bound to an Ingfragistics UltraDataSource that provides data on demand. The grid does not cache cell data.

The Recorder generates:

Code: Select all

repo.Form.TableTable.RowBand_0_row_8.MoveTo("8;10");
Mouse.ButtonDown(MouseButtons.Left);
repo.Form.TableTable.RowBand_0_row_8.MoveTo("11;52");
Mouse.ButtonUp(MouseButtons.Left);
With:

Code: Select all

RowBand_0_row_8 = ...  row[@accessiblename='Band 0 row 8']
The problem is that the test takes so long that it is unusable. It seems that Ranorex is loading all 10.000 table rows and cells when accessing "RowBand_0_row_8". Could this be?

Is there a faster workaround? How can I select a row or a cell without Ranorex loading all of the table data?

BTW, same happens when I try to track a table row with the Spy tool. It takes forever and memory usage increases a lot.

Peter

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Post by Support Team » Wed Apr 01, 2009 12:50 pm

For automating the Infragistics grid, Ranorex uses the so called MSAA technology, a common interface for controls that the control provider needs to implement. Unfortunately, the performance of the Infragistics grid implementation of that MSAA interface is very slow. In order to search for the specified row, Ranorex needs to enumerates that rows at least once (it does not enumerate the cells!) and that may take some seconds.

However, you can speed up the following operations on the rows by doing some optimization: First, you can make the row a "Rooted Folder" in your repository. That way the element will be cached for the following operations.
The second option is to wrap your code into a CacheSessionContext:

Code: Select all

using (new CacheSessionContext())
{
    repo.Form.TableTable.RowBand_0_row_8.MoveTo("8;10"); 
    Mouse.ButtonDown(MouseButtons.Left); 
    repo.Form.TableTable.RowBand_0_row_8.MoveTo("11;52"); 
    Mouse.ButtonUp(MouseButtons.Left);
    ...
}
This way all children and attributes will be cached from the first access on, consequently the rows will only be enumerated once and after that every operation should work really quickly. Remember, though, that changes made to the grid will not be reflected in the element attributes, i.e. if you change the text of a cell, the Text attribute of that cell might still have the cached value (if that attribute has been retrieved before).

Regards,
Alex
Ranorex Support Team

schlaup
Posts: 4
Joined: Sat Mar 28, 2009 6:46 pm

Post by schlaup » Wed Apr 08, 2009 8:29 pm

Thanks for the response, Alex!

Two comments:

1. "Rooted Folder" is not an option because the grid is on an MDI form and Ranorex Recorder already creates a "Rooted folder" for the MDI form. Unfortunately, nested "Rooted folders" are not supported. Correct me if I am wrong. I tried and I did not get it to work.

2. When I access row 3 does Ranorex traverse the whole grid or only until it reaches row 3? It seems that Ranorex accesses all rows and therefore it is so slow. Data access is slow in this application and that's the reason I implemented "virtual" data access with UltraDataSource so that the grid only loads data on demand. (BTW, I am talking about minutes not seconds!) - I am evaluating a competing product as well and retrieving the data from a couple of currently displayed rows takes no time at all.

Regards,

Peter

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

RE: Performance with Infragistics grid

Post by Support Team » Sat Apr 11, 2009 3:56 pm

ad 1.) You are right, nested rooted folders are not supported. However, you can just make another rooted folder for the row if you want to.

ad 2.) When searching the grid for a cell in row 3 using the FindSingle method, Ranorex does not traverse the whole grid, but goes through the rows and stops in row 3 when it finds the cell. However, as Ranorex performs a breadth-first search, it needs to enumerate all rows to search the cells then. It seems that your Infragistics grid loads the data when the row is accessed, even if the cells in that row are not accessed.
Did you try the code snippet I posted (using the CacheSessionContext)? That way only the first search should take long and all the following should go fast.

By the way, which "competing product" did you try?

Regards,
Alex
Ranorex Support Team

prabhu_thi
Posts: 8
Joined: Wed Feb 02, 2011 4:28 am

Re: Performance with Infragistics grid

Post by prabhu_thi » Mon Jul 18, 2011 1:04 pm

HI,

I am trying to automate testing for Grid (Dev Express).In which the first tow is for data filter.I need to access the filter row to set my own filter criteria.I need only the filter row to achieve this.I dont need other row.But ranorex is taking more than a minute to get this row (if there are more number of rows in the grid).But if grid have only few rows , ranorex is able to find the filter row in few seconds.

How to handle such cases....how to get only the first row with out any delay...?

As in previous post , it has been mentioned that ranorex will get all the rows on the first access...wats the solution over here..because i dont need other rows..how to make this effective...I tried with FindSingle..it doesnt help me out....

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Performance with Infragistics grid

Post by Support Team » Thu Jul 21, 2011 4:31 pm

As I explained in my previous post, there is no way for Ranorex to retrieve just the first row if all rows are children of a single element. Ranorex will always get all immediate children of the grid, that is all the row elements. Usually, that is a quick operation, but (as I wrote before) it seems that your grid implements MSAA in a very ineffective way and that's why getting the rows is so slow.

An alternative would be to use Control.InvokeRemotely in order to set the filter criteria. See following blog for more information on that technique:
http://www.ranorex.com/blog/transfering ... et-control

Regards,
Alex
Ranorex Team