Close redundant browser

上一篇 / 下一篇  2008-11-13 12:06:40 / 个人分类:QTP

1. Through descrīption object

Dim WinIe,Ie,k,m
Set WinIe=descrīption.Create()
WinIe("micclass").value="Browser"  'The property regexpwndtitle of all pages is " Microsoft Internet Explorer"
Set Ie=desktop.ChildObjects(WinIe)
m=Ie.count
If  m>1 Then
        For k=0 to m-1
        Ie(k).close        

        Next
End If
Set ie = nothing

2. Through close process

SystemUtil.CloseProcessByName "iexplore.exe"


TAG: QTP

 

评分:0

我来说两句

日历

« 2024-04-24  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 20411
  • 日志数: 32
  • 建立时间: 2007-12-13
  • 更新时间: 2008-12-04

RSS订阅

Open Toolbar