在QTP中列举当前打开的所有浏览器对象:
Public Function getNumOfBrowsers()
Dim desc
Set desc = Description.Create()
desc("micclass").Value = "Browser"
Set objBrowsersColl = Desktop.ChildObjects(desc)
getNumOfBrowsers = objBrowsersColl.Count
report micDone, "Number of Open Browsers", getNumOfBrowsers
End Function