Forum Discussion
- Marsha_R
Champion Level 3
If you set the browser name as a parameter, then you should be able to close them in any order you want.
http://support.smartbear.com/viewarticle/59604/
- gvkr1985Occasional Contributor
Thank you.. I found a solution....
Sub ClosingBrowsers
l_objBrowsers = Sys.FindAllChildren("ObjectType","Browser")
l_BrowsersCount = Ubound(l_objBrowsers)
If l_BrowsersCount >= 0 then
For I = 0 to (l_BrowsersCount)
l_ProcessName =l_objBrowsers(i).ProcessName
l_aobjPages = Sys.Browser(l_ProcessName).FindAllChildren("ObjectType", "Page")
l_pagesCount = Ubound(l_aobjPages)
For J = 0 to l_pagesCount
If l_aobjPages(J).Exists then
l_aobjPages(J).Close()
End IF
Next
Next
End If
End Sub