Making CTreeCtrl Accessible to Ranorex

Ask general questions here.
gorodish
Posts: 3
Joined: Tue Nov 02, 2010 9:28 pm

Making CTreeCtrl Accessible to Ranorex

Post by gorodish » Tue Nov 02, 2010 9:55 pm

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.

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

Re: Making CTreeCtrl Accessible to Ranorex

Post by Support Team » Wed Nov 03, 2010 3:33 pm

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
.
Image

gorodish
Posts: 3
Joined: Tue Nov 02, 2010 9:28 pm

Re: Making CTreeCtrl Accessible to Ranorex

Post by gorodish » Thu Nov 04, 2010 4:47 am

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?

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

Re: Making CTreeCtrl Accessible to Ranorex

Post by Support Team » Thu Nov 04, 2010 10:03 am

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
.
Image

gorodish
Posts: 3
Joined: Tue Nov 02, 2010 9:28 pm

Re: Making CTreeCtrl Accessible to Ranorex

Post by gorodish » Tue Nov 09, 2010 12:43 am

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.