Identify multiple open browsers with UFT
Question ID: 105649
2
0

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: 386, Answers: 64)
Asked on October 24, 2014 9:28 pm
157 views
Answers (1)
2
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
Next
If flag = 0 Then
msgbox ''Can't find browser Yahoo - Microsoft Internet Explorer''
End If

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

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top