1

I am trying to get all the open Browser objects using QTP11. The code I use is the following:

Set descBrowser = Description.Create
descBrowser("micClass").Value = "Browser"

Set objChildren = Desktop.ChildObjects( descBrowser )

During testing, i have two IE Browser windows open, but the collection returned by the code shows four found items. I checked the running processes also, which show the correct number of 2 processes running.

I have also checked with 3 Browsers open, in which case it shows 6 objects matching the descrption.

Can anybody explain why this could be happening?

Mimi
  • 23
  • 4
  • If you .Highlight the children, could it be for each browser, you get two highlights? Because a browser and its tab are one Browser object each? – TheBlastOne Jul 25 '13 at 06:46
  • If I highlight them in turn, then yes, I get two hightlights per browser. But the strange thing is that it works fine on another test machine, there is sees the correct number of browsers. Both machines are Windows 7 64 bit. – Mimi Jul 25 '13 at 07:10
  • Wasn't there some dark config setting...don't remember...hmm.. – TheBlastOne Jul 25 '13 at 07:18
  • My knowledge of the dark arts is limited in this case and I have been searching for the answer to this since two days, but no luck yet... – Mimi Jul 25 '13 at 07:50

4 Answers4

1

UFT 11.52 + Win7

I had tried several strategies to get this done(PIDs, Title, HWND, browser(index)), and still not success, I am not sure on whether this patch is already there.

What I can picture is that for a simple closing task the UFT is also having issues as it says "Object not visible" when I try to close the Browser() object crashing down the test in random fashion.

The best result was a bunch of already alive IExplorer windows(Tabs) oppened.

Can someone provide steps to check the installed patches ?

Horax
  • 11
  • 1
0

I see the same behaviour (only for IE not Firefox).

A workaround for this can be to filter out duplicates. For IE if you compare the objChildren(i).GetROProperty("hwnd") you can filter out those with the same value but this will not work if you also use Firefox since in Firefox if you have multiple tabs they all have the same hwnd.

If you have to take FF into consideration you can filter out duplicates using the CreationTime property (instead of the hwnd).

Motti
  • 110,860
  • 49
  • 189
  • 262
  • 1
    That is just what I did as a workaround :) But I would still like to know why this is happening... – Mimi Jul 29 '13 at 14:50
0

I had the same issue and I had to back out patch QTPWEB_00090 to get it to work. See if you have that QTP patch installed and back it out.

guest
  • 1
0

This is fixed in QTPWEB_00107 - Web Browser Control Recognition in Windows Explorer

Alvaro
  • 126
  • 3