Dynamically inquire all controls on form

Class library usage, coding and language questions.
AKalytiuk
Posts: 9
Joined: Fri Mar 04, 2011 2:36 pm
Location: Kyiv, Ukraine

Dynamically inquire all controls on form

Post by AKalytiuk » Fri Mar 11, 2011 6:15 pm

Hi,

Please tell, does Ranorex framework provides way to dynamically inquire and get all child controls from certain form (in order to find certain control on form)?

Actually I need to scan whole tree of controls in Eclipse main form in order to find controls with certain labels. Using XPath for finding controls in Eclipse is not stable as all controls are identified only by dynamic numeric IDs that change depending on set of sub-windows that are currently active.

I have noticed that it is possible to inquire all child controls of some item in repository using Children property of adapter while I have not found a way how to inquire all child controls of some controls-folder (repository folder) that corresponds to form or to some container control.

Please tell is it possible to instantiate adapter for form using XPath expression?

Please point me to manual about framework where it is possible to read about instantiating adapters for any control that is recognized by Spy.

Thanks.

Regards.
Andrii Kalytiiuk
Last edited by AKalytiuk on Thu Mar 24, 2011 8:06 pm, edited 1 time in total.

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Dynamically inquire all controls on form

Post by Ciege » Fri Mar 11, 2011 7:00 pm

By getting an ilist of elements you can then loop through that list and inquire about each element.

Here are a couple of links for you to read:
http://www.ranorex.com/forum/post7611.h ... list#p7611
http://www.ranorex.com/forum/post5612.h ... list#p5612
http://www.ranorex.com/forum/post4995.h ... list#p4995

You can search the forum for more comments about ilist and using for each to iterate through that list of elements.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Dynamically inquire all controls on form

Post by Support Team » Mon Mar 14, 2011 7:30 pm

AKalytiuk wrote:Please tell is it possible to instantiate adapter for form using XPath expression?
The following section in the Ranorex User Guide should also help:
http://www.ranorex.com/support/user-gui ... html#c3202

Regards,
Alex
Ranorex Team
.
Image