Ask a Question

RadTreeListView ClickItem

AnandRam
New Contributor

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. 

5 REPLIES 5
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/winf...

 

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.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

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


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

Yes, I queried the source to pick an item and used SetselectedItem on the tree view to select an item. This made the row selected. 

Its long winded, but works !    

tristaanogre
Esteemed Contributor


@AnandRam wrote:

Yes, I queried the source to pick an item and used SetselectedItem on the tree view to select an item. This made the row selected. 

Its long winded, but works !    


Good to hear!  There might be other ways to do it but, yes, that's essentially what you need to do.  What I would do from there is turn the bit of code that does that selection into a method in some code library somewhere so you can use it anytime you want to perform the same task.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
cancel
Showing results for 
Search instead for 
Did you mean: