I am working with Test Director(TD) and want to automate and validate few functionalities in it. TD is programmed in Java. I am using QTP8.0. I need to automate selection and validation of the tree structures in test plan, but QTP is not able to identify the tree elements individually as an element. Its identifying objects through coordinates only and treating the whole tree as the single object.
Can anybody suggest me a solution, where i can access the tree nodes and subnotes, by identifying each of them as single objects or an element of an tree object or an array....?
This a code snippet from the Mercury Support Site:
Public Function RightClick(JTree, Node)
set selectionPath = JTree.Object.getSelectionPath()
set rect = JTree.Object.getPathBounds(selectionPath)
x = rect.x
y = rect.y
JTree.Click CStr(x), CStr(y), "RIGHT"
'Register function and call it
RegisterUserFunc "JavaTree", "RightClick", "RightClick"
UnRegisterUserFunc "JavaTree", "RightClick"
It may need tweaking to suit your needs, like changing rightclick for left etc.