ElementDoDefaultAction on a TreeView heading
Posted: Mon Nov 05, 2007 6:48 pm
Hi,
I have a winXP SP2 box. In the app I'm testing I have a SysTreeView32 control that contains a number of elements. The default action on these elements is Expand. I'm trying to expand the element by using ElementDoDefaultAction.
I can move the mouse to the element using this code and I can click on the element using this code but when I try and expand the element it silently fails. How can I expand the treeview elements?
Thanks,
Mike
I have a winXP SP2 box. In the app I'm testing I have a SysTreeView32 control that contains a number of elements. The default action on these elements is Expand. I'm trying to expand the element by using ElementDoDefaultAction.
Code: Select all
element = Ranorex.ControlGetElement(control)
treeViewHeading = Ranorex.ElementFindChild(element, 36, heading, "SysTreeView32")
position=Ranorex.ElementGetPosition(treeViewHeading)
if element != None:
print "Found the tree view control"
else:
print "Can't find tree view control"
return -3
if (position != None and position[0] != 0 and position[1] != 0):
#Works
Ranorex.MouseMoveToElement(treeViewHeading)
#Works
Ranorex.MouseClickElement(treeViewHeading)
#Fails
Ranorex.ElementDoDefaultAction(treeViewHeading)
Thanks,
Mike