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
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
相关文章推荐
- IE关闭主窗口时,同时关闭所有的子窗口
- Java关闭所有IE窗口
- QTP关闭所有的应用程序窗口,场景恢复
- 《AndroidStudio每日一贴》8. 如何关闭除了当前文件以外的所有文件?
- C#利用Process关闭所有的IE窗口
- 无提示关闭IE窗口,目前适用于IE所有版本(目前最新为IE7.0)
- Sql查询一个表中除了某个字段以外的所有字段的方法
- IE6,IE7下关闭窗口无提示的代码
- IE,Firefox下无提示关闭窗口
- 关闭IE窗口时执行事件
- 枚举所有IE窗口,实现自动登录
- 编程实现关闭IE窗口
- linux 除了某个文件或某个目录以外所有删除
- IE 6.0、IE 7.0 无提示关闭窗口
- 怎样不弹出确认框,就直接关闭IE窗口?
- 关闭IE窗口而不要用户确认
- IE,firefox(火狐)浏览器无提示关闭窗口js实现代码小结
- 枚举窗口句柄后关闭所有窗口示例
- 【面试系列】把一个字符串里除了大小写字母以外的所有东西都去掉,然后都变成小写,之后按顺序排序
- 兼容所有浏览器的窗口关闭方法