How to Calculate Number of Opened Browsers in QTP

January 04, 2009

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


You Might Also Like

1 comments

  1. Good Approach......It is really helpfull..Request you not to make it a Discussion blog.

    ReplyDelete