Why does QTP lose its mind?

If you've been following my blog, you know that we use Mercury QuickTestPro here for our automated testing solution and I have fallen victim to one of QTP's quirks today.

For some reason I have yet to figure out QTP occasionally loses it's mind.  How can a software package lose its mind you may wonder?  Well I'd like to know the answer to that question too.

Here are the symptoms of QTP losing its mind:

Objects that QTP once knew appear to be forgotten.  Its as if QTP suffers from Alzheimer's or something.  Objects learned into the Object Repository as one object type suddenly are recognized as something else. 

For example: 

We have a object in our repository for one of the components which reads a pop-up our application will generate.  Under normal conditions, QTP reads this popup as a window and will successfully interact with the buttons on the page.  However this morning, QTP read that object as nothing but a "WinObject : Internet Explorer_Server" object.  This of course meant that it could not "see" the buttons on this page or interact with them in any way shape or form.  Now I tried the "reboot and try again" method to see if that would help; alas it did not.  So after struggling with this, I decided to take the sledgehammer approach to attempt a fix to this problem.  This entailed running two .bat files that Mercury includes with the installation of QTP which will reregister QTP's components and dlls with Window's registry.  Apparently this "Alzheimer's" issue is so common with QTP that Mercury takes the liberty in providing these .bats as a standard part of the install.  I ran these scripts and PRESTO QTP suddenly could see this window and all the child objects on it.   So I ask you, Why on earth does QTP have to be reregistered with such frequency that Mercury gives you these tools with the install????

Wouldn't this behavior be categorized as a bug???

The other issue I've found has got to be some sort of .NET compliance issue with QTP.  We have applications in our application suite which are written in .NET.  When I worked on the development of automation cases for these applications, I recorded some of the objects required to do work in the application.  These objects came in as .NET objects.  No problem, I can handle dealing with these.  NOW for some reason in at least one test case this object appears as a traditional Web Object.  Therefore QTP says, I'm sorry the object you're attempting to use does not exist on the page.  Why would QTP behave this way???  <baffled>

So now, I have figure out a way to handle this different case...do I put an If, Then,Else case in there saying if the .NET object exists, do work on it, else use the traditional Web object instead?  Sounds like a hack solution to me.  I'd rather get QTP to see it as the same object all the time....

<sigh>

I guess I should get back to fighting the good fight...  /rant off

<wields her sword to do battle with QTP once more>

 

posted @ Tuesday, July 17, 2007 1:08 PM

Print

Comments on this entry:

# re: Why does QTP lose its mind?

Left by Vijay at 12/19/2007 1:35 PM
Gravatar
Hello,
I have this strange problem. QTP doesn't recognize objects on a web page dialog and identifies them as Winobject:Internet Explorer_Server. Where as this works on few other laptops. It is very strange. And I have been struggling on this for a while. So what are those bat files you have mentioned in the blog and any other pointers/help are highly appreciated.

Thanks & regards,
Vijay

# re: Why does QTP lose its mind?

Left by reenu at 1/10/2008 3:59 PM
Gravatar
Hello,

I have a question. How do i make QTP to record events happening on a another window that has been opened curent application window(VB application).

Thanks
Reenu

# re: Why does QTP lose its mind?

Left by Cool Dude at 3/4/2008 10:32 AM
Gravatar
Can you please attach those .bat files which you run when your QTP was not recognizing that ...

# re: Why does QTP lose its mind?

Left by Maryanne Sweat at 3/6/2008 2:32 PM
Gravatar
No I will not post them, but I can tell you that they are provided by Mercury in the location where you've installed QTP in the /bin directory. I have two of them b/c I run the .NET addin for QTP as well. They are called "QuickTestProfessional.bat" and "QuickTestProfessional.NETAddin.bat"

# re: Why does QTP lose its mind?

Left by Antony at 5/8/2008 5:22 AM
Gravatar
Hi Maryanne, I seem to be experiencing the same problem as you did above, however I can't seem to remedy the problem. I've followed the same steps you have and run the batch files but to no avail.

Could I ask what version of QTP and .NET your running, maybe it's a versioning problem on my end.

# re: Why does QTP lose its mind?

Left by Maryanne Sweat at 5/9/2008 1:50 PM
Gravatar
QTP 9.2 for both base & .NET addin

# re: Why does QTP lose its mind?

Left by Bob at 5/13/2008 11:15 AM
Gravatar
Why does QTP lose its mind? Because misery loves company. I am losing my mind with this <____>. WInrunner and Test Director were not much better, tho I made due. Now 5 years later I get QTP and they have had 5 years to make it worse. But, alas, I make it work. But lose a lot of time and sleep redoing things. TOday I spent an hour recreating an Action that QTP lost for me last night while I was sleeping. SOmetimes however QTP saves me this frustration by not Recording at all. A reboot and walk around the building seems to get it going again, for a while...

# re: Why does QTP lose its mind?

Left by bal13 at 5/15/2008 5:13 AM
Gravatar
If you use the spy to look at the parent and child objects there's a proprty called RegExpression (or similar).

Delete it, look for instances of the same parent/child objects in the repository (that are underscored _1, _2 etc) - move their kids into the "real" object, then delete them! it sucks.

Good to also change the name of the parents into something meaningfull or else you end up with an ugly repository.

The comment about walking away is a good one - especially for Java obs, Jwexe runs at %50 percent - even if directly killed - and I haven't found a way to kill it off properly........

So another walk around the block.

Also, Vdev env sucks!

BaL13

# re: Why does QTP lose its mind?

Left by Maryanne Sweat at 5/15/2008 10:21 AM
Gravatar
Another way to eliminate some of the QTP mind loss is to disable "Smart Identification". Apparently "Smart Identification" is neither Smart OR terrible good at Identification. YOu can go into your Settings for the various object types you'd be adding to the Object Repository (OR) and for each one turn off Smart Identification. This will mean that going forward any objects added to the OR of those types will not have this option selected.

Another issue I've discovered is that if your QTP dev environment is integrated with QualityCenter and you convert a manual test case in Quality Center to a QTP script, Quality Center ONLY adds the "Web" add-in to the Addins list for the test. What this means is if you're using the .NET addin (like I do) it may not be selected in the test case's Addins list (visible under File/Test Properties). And therefore if you execute the test from Quality Center, QTP will only load the addins determined by the case. Therefore .NET objects in the OR won't be found b/c the .NET add-in isn't loaded.

ANNOYING but true fact. SO as a result, when I convert a case from manual to automated and start dev on it in QTP the FIRST thing I do is check the add-ins list and set the ones I need to "checked" and save the Test Properties.

# re: Why does QTP lose its mind?

Left by Phil Southard at 7/8/2008 1:31 PM
Gravatar
QTP has to be started and at the scripting screen before you open the browser or client apps. This way QTP can "hook" into the app. If you start QTP after the client app or browser it will not recognize objects correctly

# re: Why does QTP lose its mind?

Left by MES at 7/8/2008 4:47 PM
Gravatar
Yes Phil, I am aware that you must have QTP started prior to initiating the browser or client application. This behavior is observed even when that rule is adhered to. Its a goofy problem with the tool that executing those .bat files corrects.

# re: Why does QTP lose its mind?

Left by Dileep at 9/3/2008 4:25 PM
Gravatar
Iam using QTP 9.2 and IE6. I am seeing WinObject("Internet Explorer_Server") during the Object Identification /or with "Object Spy" for Every Object.

Is there a solution?
Can somebody comment on this.

# re: Why does QTP lose its mind?

Left by MES at 9/3/2008 4:51 PM
Gravatar
Dileep,
Have you confirmed that you are starting the browser AFTER the initialization of QTP?

Suggestions would be to checkout the TDForums link the right nav of my blog. There are a lot of good people in that group who could help you further.

# re: Why does QTP lose its mind?

Left by kathita at 11/7/2008 1:30 AM
Gravatar
I selected the radio button
"Record and run test on any windows based application " in windows tab of Record and Run Settings of QTP and it worked .It identified the object correctly

# re: Why does QTP lose its mind?

Left by mike at 1/13/2009 1:30 PM
Gravatar
I can't tell you how many times I have read this post when QTP loses its mind for me. It is almost that necessary zen moment required to be able to deal with the issue.

# re: Why does QTP lose its mind?

Left by MES at 1/13/2009 4:51 PM
Gravatar
Yeah and you know what, HP removed these bat files from the 9.5 install. So if you need to do this with 9.5, you're looking at a reinstall of the system. Ain't that great?

# re: Why does QTP lose its mind?

Left by Cornell at 9/18/2009 3:28 PM
Gravatar
It's been a daily occurrence for me. It's good that I'm doing a cost analysis. I've never had problems like this with TestPartner.

Your comment:



 (will not be displayed)


 
 
 
 
 

Live Comment Preview:

 
«November»
SunMonTueWedThuFriSat
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345