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


How to Calculate Number of Opened Browsers in QTP How to Calculate Number of Opened Browsers in QTP Reviewed by Animesh Chatterjee on January 04, 2009 Rating: 5

1 comment:

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

    ReplyDelete

Powered by Blogger.