QTP拖动对象的脚本

发表于:2008-09-04来源:作者:点击数: 标签:qtpQTP脚本拖动对象
Set shell = CreateObject("Wscrīpt.Shell") shell.Run "C:\ WINDOWS \system32\calc.exe" Window("regexpwndtitle:=计算器").Activate Dim x_source , y_source Dim x_goal , y_goal Dim Device 'DeviceReplay对象 x_source = Window("regexpwndtitle:=计


Set shell = CreateObject("Wscrīpt.Shell")
shell.Run "C:\WINDOWS\system32\calc.exe"

Window("regexpwndtitle:=计算器").Activate

Dim x_source , y_source
Dim x_goal , y_goal
Dim Device  'DeviceReplay对象

x_source = Window("regexpwndtitle:=计算器").GetROProperty("abs_x") + 50
y_source = Window("regexpwndtitle:=计算器").GetROProperty("abs_y") + 10

x_goal = x_source +100
y_goal = y_source + 100

Set Device = createobject("Mercury.DeviceReplay")

Device.DragAndDrop x_source , y_source , x_goal , y_goal , LEFT_MOUSE_BUTTON

set shell = Nothing
set Device = Nothing


 

原文转自:http://www.ltesting.net