QTP: 9.5 descriptive programming issue

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.

QTP: Strong case for not using checkpoints

I recently upgraded one of my lab machines to 9.5 to check out the new Delphi plug-in for QTP. I created a test in 9.5, and tried to open it in 9.2 later. I got the following:




I've already run the patch to enable 9.2 to read 9.5 files (available on Hp site), so that's not likely the problem. I like my checkpoints to be in code rather than rely on QTP to manage them. If this test was crucial and you'd upgraded, you'd be in for some painful re-work to get it going. It's also why I prefer to use descriptive programming for object recognition as much as possible, too.

Now, I know, I know....if you've upgraded to 9.5, then you shouldn't be using 9.2 so who cares. My point isn't that you shouldn't upgrade, but rather it is a good idea to write your tests independent of QTP's native functionality when possible.

More on 9.5 to come...
«July»
SunMonTueWedThuFriSat
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789