Forum Discussion

AnandRam's avatar
AnandRam
New Contributor
8 years ago

RadTreeListView ClickItem

Hi All,

 

We use Telerik RadTreeListView, this can have the child items to any level(attached picture) . I am trying to select an item in the tree and I found treeObj.ClickItem() is missing on the RadTreeListView object. And I pressume this is specific to Win32 ListView and Infragistics UltraListView Controls. 

 

Would be great if you could help me to find a way to select an item in the Telerik RadTreeListView. Thanks in Advance. 

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Can you give us the Object Spy properties list?  That will help a bit more than just a screenshot.

     

    In the meantime, Telerick RadTreeView control is supported out of the box as https://support.smartbear.com/testcomplete/docs/reference/test-objects/controls/desktop/telerik/winforms/tree-view/methods.html

     

    There's  not something specifically called RadTreeListView supported directly in TestComplete however, you could always edit your project's Object Mapping to map the component to something closely compatible.

    • AnandRam's avatar
      AnandRam
      New Contributor

      Hi Martin, 

       

      Thanks for your quick reply. Please find the attached properties screen shot. 

       

      As you suggested, I changed objectmapping to be compatable treeview and I called clickitem as tree.ClickItem("|[1]"); On this I got the following error. 

       

      Aliases.Trinity.HwndSource_Shell.Shell.RadDocking.RadSplitContainer.RadPaneGroup.RadOutlookBar.TreeListView.wItems.Item(1) (Sys.Process("Trinity").WPFObject("HwndSource: Shell", "AddLink_Test - Trinity").WPFObject("Shell", "Trinity", 1).WPFObject("Grid", "", 1).WPFObject("RadDocking", "", 1).WPFObject("RadSplitContainer", "", 1).WPFObject("RadPaneGroup", "", 1).WPFObject("NavigationView", "", 1).WPFObject("RadOutlookBar", "", 1).WPFObject("NavigationItemView", "", 1).WPFObject("ContentControl", "", 1).WPFObject("FsRootView", "", 1).WPFObject("DockPanel", "", 1).WPFObject("FsTreeControl").WPFObject("Grid", "", 1).WPFObject("TreeListView").wItems.Item(1))

      1. The application stopped responding.
      2. The application was compiled incorrectly (see the Open Applications topic in the help system).
      3. An error occurred in TestComplete/TestExecute.

      Technical information:
      103 0x80020006 (Unknown name.) ContainerFromItem. 
       
      Not sure why I got this though.  ?
       
      Thanks

       

       

       

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        Most likely the error is because the RadTreeListView is not EXACTLY the same as the object you mapped it to... so, TestComplete is going to have some problems with doing the same sorts of things.

         

        Looking at your property list and your object browser, I think you're going about this wrong. The way that TestComplete is "reading" your component is that the actual items are, themselves, child objects of the tree list view.  Notice you have five "TreeListViewRow" objects.  I can't be sure, but it seems that these relate directly to the 5 rows in your tree view on screen.  To click on an "item" in your tree list view would be to click on one of those child objects, not to call a "ClickItem" method on the tree view itself.  

        So... what it seems to me is that you should write some sort of script routine that will simulate a ClickItem. I'd use FindChild to find the specific TreeListViewRow object that corresponds to the desired text string/index you want and execute a click on that item.  You might need to add code to do an expand of the tree so that you can expand nodes that may be collapsed.

        So... undo your object mapping and start down the road of investigating what you have exposed natively.  You should be able to find a combination of methods and properties to do what you want built in to the object itself.