FindChild taking a very long time, anything faster

Class library usage, coding and language questions.
slim7
Posts: 1
Joined: Tue Dec 18, 2007 8:38 pm

FindChild taking a very long time, anything faster

Post by slim7 » Tue Dec 18, 2007 8:45 pm

I have a tabbed app written in old foxpro and each tab has many controls on it. the parent app i get by class name contains all the tabs. And so when i do a search for these controls its terribly slow. Is this because i have so many tabs w/ lots of controls on it. Is there a faster way to search for the controls. It finds the controls eventually but ends up the test we have written is way too slow. Thanks for any ideas.....??????????

Code: Select all

Ranorex.Form parent= Ranorex.Application.FindFormClassName("className",2);
Element _el = parent.Element.FindChild(Role.Text, element_name);
Most of these are Role.Text

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 Dec 19, 2007 5:48 pm

You can first try to search for a single tab page and then search that tab page for your controls. That avoids searching the first tab page if you e.g. search for a control in the second one.

Generally, it's also much faster to search for controls (i.e. by control id) than searching by elements, as every control has a large number of elements, and thus the number of elements is far greater than the number of controls.

And the last thing you may try is to search only for visible elements (supported only in Ranorex Pro):

Code: Select all

RxElementIgnoreInvisible(TRUE);
Alex
Ranorex Support Team