Geeks With Blogs

News QTP and Stuff
Theo Moore Questions... Morphology? Longevity? Incept dates?
I rely heavily on descriptive programming (DP) in my scripting. QTP's object recognition (OR) can be a little quirky sometimes, and I find that using DP minimizes those quirks....usually.

I upgraded one of our test machines from 9.2 to 9.5 recently, and promptly discovered a problem:

You can no longer use the Windows handle to reliably refer to Browsers (possibly all objects). I have a function that opens browsers for me and logs the hwnd of the browser so that when I need to clean up after an error or test completion, I have a reliable list of hwnd to find and close those browsers. This has the added benefit of allowing me to leave other browsers open that I want open; only the ones the test opens are added to the list and therefore closed. I hear you saying I should use the "openedbytestingtool" property, and that works...so long as you don't click links that spawn child browsers...but I digress....

Anyway, the following code used to work perfectly in 9.2:
Browser("hwnd:=112456").GetROProperty("url")

In 9.5, however, it won't recognize the browser. It lists the hwnd among the properties of the browser, but cannot seem to refer to the object by using it.

I've contacted Hp support on this, and will post what they suggest. Posted on Wednesday, July 2, 2008 4:18 PM | Back to top


Comments on this post: QTP: 9.5 descriptive programming issue

Comments are closed.
Comments have been closed on this topic.
Copyright © Theo Moore | Powered by: GeeksWithBlogs.net