Test Complete: How to get the X/Y coordinates of an item in a TreeView control
I am using TestComplete 14.74
I am trying to test a Drag/Drop feature in a TreeView control (implemented in C++/MFC). I can get the position of the TreeView itself but, cannot for the life of me, figure out how to get the X,Y of the tree item that is currently selected.
The Tree is like this and I would want to drag Level 1.1.1 to Level 2.1.1
| Level 1
| Level 1.1
| Level 1.1.1
| Level 2.1
| Level 2.1.1
The TreeView control is mapped and aliased
myApp = Aliases.MyApp
sysTree = myApp.MainFrame.ConfigurationManager.SystemViews.TreeView
Thanks in advance
Solved! Go to Solution.
You need to get required object (e.g. 'Level 1.1.1') and then use its properties to get X, Y coordinates that you need (usually - .Top, .Left, .Height and .Width ones).
Check if https://support.smartbear.com/testcomplete/docs/reference/test-objects/controls/desktop/win32/tree-v... help article helps.
/Alex [Community Hero]
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.