TA的每日心情 | 奋斗 2022-7-13 15:22 |
---|
签到天数: 1 天 连续签到: 1 天 [LV.1]测试小兵
|
转载自 http://www.17testing.com
'UI_object : The object on UI which you want to right click the mouse.
'Menu_index : the menu's index, which one you want to select
Function RightMouseAction( UI_object, Menu_index)
Set obj = CreateObject("Mercury.DeviceReplay")
Set WshShell = CreateObject("WScript.Shell")
'Get the absolute coordinates of the ibject
absx = UI_object.QueryValue("abs_x")
absy = UI_object.QueryValue("abs_y")
obj.MouseClick absx+3, absy+3, 2
'Optional wait statement
wait(2)
'Menu_index = 4
For i = 1 To Menu_index
WshShell.sendkeys "{DOWN}"
wait(1)
Next
WshShell.sendkeys "{ENTER}"
Set WshSEll = nothing
Set obj = nothing
End Function
测试过可以用,同时把我测试的脚本上传,希望对你有帮助
|
|