QTP 10, Vista and IE8

If your question is whether QTP 10 supports IE8 on Vista, the answer is "Yes". At least, thats what HP QuickTest Professional 10.00 Patch QTPWEB_00037 Readme File says. The documentation also says
"This patch provides official support for testing Web applications in Internet Explorer 8.
It includes support for working with Internet Explorer 8 on all operating systems that QuickTest Professional supports."
QTP 10 supports Vista, so this also means that IE 8 on Vista is supported. However not everything looks rosy here because when I try to spy on IE8 in Vista....this is what I see..




QTP recognizes the browser as a Window object instead of Browser. Now this is not always the case. In some cases (for which I have no explanation) it does recognize IE8 as a Browser object. So I would be reluctant in stating that QTP 10 supports IE8 on Vista "completely" !!!!!

All that said and done, let me get into the reason why I wanted to write this article. I had got stuck with a problem where I wanted to activate a browser. I am sure you would also have known by this time that you activate a browser by getting the handle of the browser and then do a Window("hwnd:=" & hwnd).Activate. Well, lets try it here...but before that we have a sort of chicken and egg problem here... if we are unable to recognize the browser then how do we get its handle !!! One way is to use the object spy on the browser and get the handle... the other way is by knowing that the regexpwndtitle property of such a window would be "Windows Internet Explorer" and nativeclass property would be "IEFrame" and another way would be to use Description objects. Lets use the properties here ..

wHandle = Window("regexpwndtitle:=Windows Internet Explorer", "nativeclass:=IEFrame").GetROProperty("hwnd")
Window("hwnd:=" & wHandle).Activate
There you go ... it worked !!!
Just make sure that if your browser is in "Full Screen" mode, the Activate method would not work so make use of the "Click" method instead of Activate.
I hope this saved you time "googling" further for this problem and you got a resolution.

Update: Oh boy !!! Why didn't I know this earlier ?? Just figured out why IE8 was not being recognized as a browser in Vista. I usually work on Vista as a standard user and have my UAC (User Access Control) set to "ON". This is because it gives an added security and gives you more control over unauthorized access on your system. For some reason, I had to uncheck the UAC option. Of course, you can do this only as a user with administrative privileges. And Voila .... QTP started to recognize IE 8 as a browser with absolutely no problems. Now is this problem only on IE8. Not really !! I downgraded my IE8 to IE7 but still it was being recognized as a Window. So all this while, UAC was the culprit. OK...so things are resolved, but I would want to test on Vista with the UAC set to ON !! H-m-m... will investigate further and let you know if there is any solution.

I dont want to have any sort of copyright or copyleft in this site but if you are reusing this code in any other site, I would appreciate you to provide this page as a link so that others get a more descriptive explanation of this concept. Your suggestion and comments are always welcome. Cheers !!!
As always,
Your friend in need,

George, Reju

Read Users' Comments (5)

5 Response to "QTP 10, Vista and IE8"

  1. Rahul says:
    December 29, 2009 at 10:32 AM

    First of all. Thanks very much for your useful post.

    I just came across your blog and wanted to drop you a note telling you how impressed I was with the information you have posted here.

    Please let me introduce you some info related to this post and I hope that it is useful for software testing community.

    There is a good Software Testing resource site, Have alook

    http://SoftwareTestingNet.com

    simi

  2. Christian Desserich says:
    February 3, 2010 at 9:28 AM

    Hey, even though I was not having the same issue, I found Window("hwnd:=" & hwnd).Activate here and it helped me with my issue. See, I guess not everyone knew that by now! Thanks for the info!

  3. Reju George says:
    February 15, 2010 at 1:29 PM

    Yes Christian... A browser could work similar to a window through the above method. You could also make use of the "Maximize" and "Minimize" methods of a window on a browser which otherwise does not exist for the Browser object.

    George, Reju

  4. Anonymous Says:
    February 25, 2010 at 11:23 AM

    thanks man .. even i am facing this problem i am using QTP9.2 and IE 8 ..... thanks a lot ..

  5. Reju George says:
    February 25, 2010 at 1:17 PM

    Anonymous, Nice to know that its working for you.

    George, Reju

Post a Comment

Visitors

Website Counter