Identify multiple open browsers with UFT

  • Questions
  • Identify multiple open browsers with UFT
Question ID: 105649

Our application can spawn multiple browsers and each on has a different title, so how do I pick and choose a specific browser during my test?

Marked as spam
Posted by (Questions: 339, Answers: 20)
Asked on October 24, 2014 9:28 pm
Answers (1)
Private answer

This example is from HP's document KM203955. It seems to work pretty well. You'll have to modify it a little for your specific use.

Set oDesc = Description.Create()
oDesc(''micclass'').Value = ''Browser''
Set oBrowsers = Desktop.ChildObjects (oDesc)
flag = 0
For i=0 To oBrowsers.Count - 1
title = oBrowsers.Item(i).GetROProperty(''title'')
msgbox title
' check if the browser with title ''Yahoo - Microsoft Internet Explorer''
If Left(title, 5) = ''Yahoo'' Then
flag = 1
Exit For
End If
If flag = 0 Then
msgbox ''Can't find browser Yahoo - Microsoft Internet Explorer''
End If

Marked as spam
Posted by (Questions: 16, Answers: 749)
Answered on October 24, 2014 9:31 pm
I did have to modify it some but it does suit my needs. Thanks!
( at October 24, 2014 9:33 pm)