标签:
‘———————————————————————————————————————————
‘名称:MaxIE
‘作用:最大化IE
‘使用:QTP.MaxIE(BrowserCreationTime)
Function MaxIE(BrowserCreationTime)
On Error Resume Next ‘开启错误处理,不弹出错误。
If Cint(Browser("CreationTime:=" & BrowserCreationTime).GetROProperty("width")) > 1300 Then
Exit Function
End If
Dim IEversion
IEversion = Browser("CreationTime:=" & BrowserCreationTime).GetROProperty("application version")
Select Case IEversion
Case ""
msgbox"【警告】获取IE浏览器版本失败。"
Case "internet explorer 6"
Dim BrowserHwnd
BrowserHwnd = Browser("CreationTime:=" & BrowserCreationTime).GetROProperty("hwnd")
window("hwnd:=" & BrowserHwnd).Maximize
Case Else
If BrowserCreationTime = 0 Then
Window("nativeclass:=IEFrame","index:=" & BrowserCreationTime).Maximize
wait 1
Else
Browser("CreationTime:=" & BrowserCreationTime).FullScreen
wait 1
End If
End Select
If Err.number <> 0 Then
magbox"【警告】最大化IE浏览器失败。Err.description = " & Err.description
Err.Clear
End If
On Error Goto 0 ‘关闭错误处理,弹出错误。
End Function
标签:
原文地址:http://www.cnblogs.com/marcello/p/4501551.html