Java Tree Click????
I'm facing problem with Java Tree, when use method click in with object as belowobjTree.JavaTree("JTree").Click 124,132,"RIGHT"
But I don't know the value where they come from & how do we know this value?
Do have another ways to create the right click action on specific item in Java Tree?
Thnks for advance 你可以用QTP的SPY
她可以查出你的XAND Y 坐标是多少! Thnks for your help
But I think this way only apply for design time. how about this x, y at runtime?
Ex: I have flow action
Step1: Add new node A into tree
Step2: Select node A & right click -> popup a context menu
Step3: Select menu item in context menu -> The node A will be delete x y 是WINDOWS的坐标.当你的菜单改变时,录制的坐标也会跟着改变,
所以你只能用QTP的SPY来辨认X Y坐标!
好像没有其它的方法!
不知道我的理解有没有问题! objTree.JavaTree("JTree").Click 124,132,"RIGHT"
这个RIGHT是什么意思?
124,132应该是相对坐标。 应该是右键吧! objTree.JavaTree("JTree").Click 124,132,"RIGHT"
This code mean right click at position (124, 132) 我认为可以省去x,y,直接修改为objTree.JavaTree("JTree").Click ,,"RIGHT" 不知道是不是您要的,请参考一下:
因为直接录制,取得的是座标,所以反过来,
先设定好我要取的节点,让他去计算x, y.
其中node包含父节点和子节点,意思是说如果是A下面有B, 则node = "A:B" 。
Call RightClick(TestWin,TestJTree, TestJNode)
'下面是function,为了取得该node的 x, y座标。
Public Function RightClick(JWin,JTree, Node)
JWin,JTree.Select Node
set selectionPath = JWin.JTree.Object.getSelectionPath()
set rect = JWin.JTree.Object.getPathBounds(selectionPath)
x = rect.x
y = rect.y
JWin.JTree.Click CStr(x), CStr(y), "RIGHT"
End Function
參考:AdvancedQTP Forum I can answer the question which you vote for.
the market X,Y means the postion relative for the howle Windows .
the Abs_X or Abs_Yis ablolute market on you application.
pay attention it on you application's market.
页:
[1]