在回放过程中,怎么保证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学习心得

 

评分:0

我来说两句

日历

« 2024-05-08  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 26131
  • 日志数: 17
  • 图片数: 2
  • 建立时间: 2007-01-16
  • 更新时间: 2007-11-27

RSS订阅

Open Toolbar