Header Ads

How to Calculate Number of Opened Browsers in QTP

Most of the time I have seen my juniors are struggling about how to calculate number of open browsers in QTP.I tried a simple way so that that method which will calculate number of opened browsers through QTP.



Function Browser_Count()
Set objBrowser =description.create()
objBrowser("micclass").value="Browser"
Set sBrowsers=desktop.childobjects(objBrowser)
ibCount=sBrowsers.count
If ibCount<>0 Then
Browser_Count=ibCount
Else Browser_Count=1
End if
Set objBrowser=Nothing
Set sBrowsers=Nothing
End Function


Powered by Blogger.