Forum Discussion
I could not find the "BrowserWindow" object as you can see below.
we wrote a script (called it CloserBrowser) with below code. works fine
function closeBrowser()
{
while (Sys.WaitBrowser().Exists)
Sys.WaitBrowser().Close();
}
- Rodrigo2010 years agoContributor
Thank you very much!
- gvkr198510 years agoOccasional Contributor
It does not work if you open both Explorer and chrome at a time...
- gvkr198510 years agoOccasional Contributor
Use the below code to close the browsers....to close any open browser...
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
Related Content
- 4 years ago
Recent Discussions
- 41 minutes ago