| || |
Trying to Left click on a right click menu on a WinTreeView
I am trying to right click on a node in my WinTreeView, then Left click on the menu that pops up.
I can get the right-click menu to come up by doing this:
Window("MyWindow").WinTreeView("trvTree").Select "Top Node Level;P-Q;Qa Test node", micRightBtn
Now I have a menu coming off 'Qa Test node' as I wanted.
But how do I left click on that menu? When I left click while recording, QTP just ignores me....it does not make the selection, it does not create any code.
I have tried to do something like : (I know this isn't how ChildObjects works...this is my psuedo-code...this is how I WISH ChildObjects worked!)
set Obj = Window("MyWindow").WinTreeView("trvTree").ChildObj ects("Top Node Level")
set obj2 =Obj.ChildObjects("P-Q")
set obj3 = obj2.ChildObjects("QA Test node")
Then maybe I could do:
set obj4=obj3.ChildObjects("That right-click menu that pops up") ' Somehow!!
obj4.Select "MyMenuChoice", micLeftBtn 'Maybe once I have a grip on the menu object, I can click on it.....
Hopefully you aren't laughing too hard right now.
Well that doesn't work because I can't figure out how ChildObjects works, and I'm not sure this is the right approach anyway.
Should I keep trying to figure out ChildObjects and do it as outlined above, or is there a better way to do this?
Obviously I am new at this, I have beat my head on this one a long time, and I would really appreciate any help.
If ChildObjects is the correct way to do it, then I will ask questions about how to make ChildObjects work...but first I want to know if there is a better approach.