Micro Focus QTP (UFT) Forums
How to identify top browser from a lot of browsers? - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: How to identify top browser from a lot of browsers? (/Thread-How-to-identify-top-browser-from-a-lot-of-browsers)

Pages: 1 2


RE: How to identify top browser from a lot of browsers? - MVChowdary - 03-06-2009

Hi guocnc,

Why are you going to calculate all browsers..? in Same browser you are clicking link 3.

No need to count the all browsers and Sreekanth provided solution is works fine.


RE: How to identify top browser from a lot of browsers? - guocnc - 03-06-2009

Thanks for MVChowdary,

There is some hidden condition in the solution. CreationTime:=0 means the frist open browser. If there are some browsers in desktop, how do we know which browser is currently working? And after executing Links(3).click, the browser should be at the top of a list of browsers. So we should count all the browsers in order to identify the top browser. If we can use other system way to identify top browser, then maybe it is another solution.


RE: How to identify top browser from a lot of browsers? - bfakruddin - 03-12-2009

Here it is very simple......... in for loop it starts (0) first browser to (browco-1) recent browser.... you can get any info about any browser on desktop by using below code and just modify as per your requirement

Code:
Dim bro
Set bro=description.Create
bro("micclass").value="Browser"

Set brow=desktop.ChildObjects(bro)
browco=brow.count
print browco

For i=0 to browco-1
    ind=brow(i).getroproperty("text")
    print ind
Next