Forum Discussion

vthomeschoolmom's avatar
vthomeschoolmom
Super Contributor
13 years ago

TListTreeViewControl by Bennet-Tec

So my developer tells me that this control is "a pretty standard treeview control. It is reporting class AfxOleControl42. I added it to object mapping. When I record, the recorder is recording coordinate clicks on the object.  It really does not look like it is being recognized as a treeview object.



I may be able to get to native methods, but doing that will often bypass event handlers within the application. Has anyone used this control before?

6 Replies

  • I am by passing the need to do this by using other user interface elements and simulating key strokes. Thanks!


  • It seems you have some questions about our TListTreeView component

    This is a wrapper component written around our base TList control.



    For general information on TList and TListTreeView component

    see www.Bennet-Tec.com/BTProducts/TList.



    If you  have questions about TList and TListTreeView you can submit

    these at   http://www.bennet-tec.com/scripts/ttcgi.exe?command=SoloSubmitScreen&databaseid=2

    Please include as much background information as you can with your question

    so that we can help



         - Jeff  Bennett

            Bennet-Tec Information Systems, Inc

            www.Bennet-Tec.com

  • When I saw your name in the reply, I thought BINGO! Thanks for the super helpful info!


  • So Test Complete has some methods that makes clicking tree view nodes really easy. But my tree is not being recognized as such. The class name reported is AfxOleControl42. As near as I can tell, that is Windows run home to mamma name when it does not know what to call it? I tried selecting auto-correct Afx window class names, but that did not help. I stuck the class name in object mapping just for giggles. Nada.



    Does anyone work with this control and know how to get TC to recognize it? Thanks


  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)
    Hi Lane,



    To automate standard Windows controls, TestComplete uses Windows messages. So, mapping a custom control to the corresponding standard Windows control has effect only if the custom control handles Windows messages properly. The TListTreeView control doesn't seem to process Windows messages, that's why, Object Mapping has no effect on it.



    A possible option is to enable Text Recognition for the AfxOleControl42 class - this should make TestComplete identify the tree items as individual objects in the Object Browser and during the test recording.



    Or, if you prefer to automate the TListTreeView control using native methods, while still having user interaction events fired, I would recommend that you use an approach similar to the one I've suggested in this thread of yours. That is, instead of using native methods to change the item selection, etc., use them to calculate the coordinates of the target item and then click by these coordinates. Judging by the TListTreeView documentation, it seems that the GetItemRect method is what you would need for this purpose.



    By the way, be sure to cast your vote for the TListTreeView control in our survey, under the ActiveX > Bennet-Tec Information Systems category:

    http://smartbear.com/products/qa-tools/automated-testing/survey/

    If it receives enough votes, the TestComplete team will definitely consider implementing out-of-the-box support for this control.
  • The Text Recognition is interesting to me. But the help file says it is available in Enterprise edition only. I will read further on it and see if it warrants my recommending to my boss. Your explanation of windows controls and object mapping was very enlightening.



    I wound up bending that particular bit of UI to my will by using other controls on the form and a series of consistent key strokes.  But I definitely will look at the calculating of coordinates with the info you gave me.



    Thanks so much for your reply.