在回放过程中,怎么保证IE窗口总是最大化?
上一篇 /
下一篇 2007-07-12 17:08:10
/ 个人分类:QTP学习心得
http://bbs.51testing.com/thread-79929-1-13.html
http://www.51testing.com/?4696/action_viewspace_itemid_12121.html
上面那个链接并没有介绍最大化IE窗口的方法(我参考他的方法修改如下),而第二个链接是改变QTP本身窗口的大小
'Open an IE browser with the method CreateObject()
Dim objIE, hwndIE
Set ōbjIE = CreateObject("internetexplorer.application")
objIE.Visible = true
objIE.Navigate "http://www.tudou.com/index.html" 'The parameter URL is the destination address for the IE browser
'Wait a while till the page is fully loaded
Wait(10)
'Move and resize the browser
hwndIE = objIE.HWND
'Operate the IE browser as a window object with descrīptive programming
'The window object can be uniquely identified by the parameter hwndIE, which is the window's handle of the browser
'Window ("hwnd:=" & hwndIE).Minimize '最小化
Window ("hwnd:=" & hwndIE).Maximize '最大化
'Release the object after the adjustment
Set ōbjIE = nothing
获取新打开的IE窗口的句柄
dim hwndIE
hwndIE=Browser().GetROProperty("HWND")
Window("hwnd:=" & hwndIE).Maximize
收藏
举报
TAG:
QTP学习心得