Page 1 of 1

Making CTreeCtrl Accessible to Ranorex

Posted: Tue Nov 02, 2010 9:55 pm
by gorodish
Recently I have been working on getting a CTreeCtrl subclass to show up in Ranorex, but it has been surprisingly difficult. Although Ranorex correctly shows the tree structure (i.e. nodes are arranged correctly), every node is shown simply as 'TreeItem' without the actual node text. Most other accessible properties (such as screen location or visibility) are also empty or zeroed out. Shouldn't the default CTreeCtrl implementation of IAccessible already provide correct information? As a test, I overrode get_accChildCount in the subclass, and browsing the control with Ranorex doesn't cause it to be called. However, browsing it with AccExplorer does result in the method getting called. Is there something special I must do to make the CTreeCtrl work well with Ranorex? Any suggestions would be appreciated.

Re: Making CTreeCtrl Accessible to Ranorex

Posted: Wed Nov 03, 2010 3:33 pm
by Support Team
Hi,

Please take a look to following blog. In this blog will be explained how to enable automation for third party controls. http://www.ranorex.com/blog/enabling-au ... s-controls

We have also a new Plug-In for such controls. Please take a look to following blog
http://www.ranorex.com/blog/automation- ... re-plug-in

Regards,
Peter
Ranorex Team

Re: Making CTreeCtrl Accessible to Ranorex

Posted: Thu Nov 04, 2010 4:47 am
by gorodish
Thanks for the response and the links. I should have mentioned that the CTreeCtrl I'm using is the basic one provided in MFC, so it's not a third-party product. Do you still think I'll need to add my own accessible methods to make it work with Ranorex?

Re: Making CTreeCtrl Accessible to Ranorex

Posted: Thu Nov 04, 2010 10:03 am
by Support Team
Hi,

For such legacy controls, I would suggest you to use the RawText Plug-In. You don't need to implement accessibility to your element if you use this Plug-In. Have you tried it yet?
gorodish wrote: Do you still think I'll need to add my own accessible methods to make it work with Ranorex?
Yes you need your own accessible methods that Ranorex can access the elements of the tree.

Regards,
Peter
Ranorex Team

Re: Making CTreeCtrl Accessible to Ranorex

Posted: Tue Nov 09, 2010 12:43 am
by gorodish
Well, it turns out that the issues I had been seeing came down to user error. Our app is 32-bit but I had been using the 64-bit version of Ranorex Spy. :cry: Thanks for your help, and sorry for the wasted energy.

By the way, the RawText plugin looks really cool.