您的位置:首页 > 编程语言 > Qt开发

QTP关闭除了ALM/QC以外的所有IE窗口

2010-09-07 13:52 218 查看
1:

function Close_IE_Except_ALM

Set obj = CreateObject("Shell.Application")

Set obj1 = obj.Windows

For Each objIE in obj1

If objIE.name = "Windows Internet Explorer" Then

If Not Instr(Ucase(objIE.Document.Title),"HP QUALITY CENTER")>0 Then

objIE.Quit

wait(1)

If Dialog("nativeclass:= #32770").WinButton("text:=OK").Exist Then

Dialog("nativeclass:= #32770").WinButton("text:=OK").Click

End If

End If

End If

next

end function

2:

function Close_IE_Except_ALM

Dim WinIe,Ie,i

Set WinIe=description.Create()

WinIe("regexpwndtitle").value=" Windows Internet Explorer"

Set Ie=desktop.ChildObjects(WinIe)

For i=0 to Ie.count-1

On error resume next

if not instr(Ucase(Ie(i).getroproperty("Title")),"HP APPLICATION LIFECYCLE")>0 then

Ie(i).close

end if

On error goto 0

Next

set WinIe = nothing

end function
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: