Geeks With Blogs
Maryanne's Blog Another Geek with A Blog

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 on Tuesday, July 17, 2007 1:08 PM QuickTest Pro | Back to top


Comments on this post: Why does QTP lose its mind?

# re: Why does QTP lose its mind?
Requesting 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
Left by Vijay on Dec 19, 2007 1:35 PM

# re: Why does QTP lose its mind?
Requesting 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
Left by reenu on Jan 10, 2008 3:59 PM

# re: Why does QTP lose its mind?
Requesting Gravatar...
Can you please attach those .bat files which you run when your QTP was not recognizing that ...
Left by Cool Dude on Mar 04, 2008 10:32 AM

# re: Why does QTP lose its mind?
Requesting 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"
Left by Maryanne Sweat on Mar 06, 2008 2:32 PM

# re: Why does QTP lose its mind?
Requesting 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.
Left by Antony on May 08, 2008 5:22 AM

# re: Why does QTP lose its mind?
Requesting Gravatar...
QTP 9.2 for both base & .NET addin
Left by Maryanne Sweat on May 09, 2008 1:50 PM

# re: Why does QTP lose its mind?
Requesting 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...
Left by Bob on May 13, 2008 11:15 AM

# re: Why does QTP lose its mind?
Requesting 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
Left by bal13 on May 15, 2008 5:13 AM

# re: Why does QTP lose its mind?
Requesting 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.
Left by Maryanne Sweat on May 15, 2008 10:21 AM

# re: Why does QTP lose its mind?
Requesting 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
Left by Phil Southard on Jul 08, 2008 1:31 PM

# re: Why does QTP lose its mind?
Requesting 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.
Left by MES on Jul 08, 2008 4:47 PM

# re: Why does QTP lose its mind?
Requesting 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.
Left by Dileep on Sep 03, 2008 4:25 PM

# re: Why does QTP lose its mind?
Requesting 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.
Left by MES on Sep 03, 2008 4:51 PM

# re: Why does QTP lose its mind?
Requesting 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
Left by kathita on Nov 07, 2008 1:30 AM

# re: Why does QTP lose its mind?
Requesting 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?
Left by MES on Jan 13, 2009 4:51 PM

# re: Why does QTP lose its mind?
Requesting 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.
Left by Cornell on Sep 18, 2009 3:28 PM

# re: Why does QTP lose its mind?
Requesting Gravatar...
Phil southard answer is perect.thanks phil.its working or me
Left by basu on Jun 05, 2010 2:40 AM

# re: Why does QTP lose its mind?
Requesting Gravatar...
..Because QTP must be one of the crappiest SW I have ever encountered. I am Developer, and generally enjoy developing in any language. When I was being Test-"Automator" and Test Manager for about a year, QTP actually managed that I am now trying to stay as far as I can from Testing, as soon as I hear "QTP".

We had to build a framework, that literally does the stuff QTP SHOULD be doing, and essentially only used the Excel interface and its browser-access-engine, sotosay.

I currently am back to help out that company, now though QTP11 and Windows 7, and yes, things got really bad now. Nothing works, or randomly, depends on which machine one is using!

"You have to open the Browser after you open QTP"..

doooh!

this will be my personal most hated, repeated much too often, technical advise ever.

And one of the best is: If you can, AVOID QTP, dont even get close to this piece of crap.

Good luck!
Left by Werner on Nov 10, 2010 6:21 AM

# re: Why does QTP lose its mind?
Requesting Gravatar...
I'm just so damn glad its not just me that runs into this inexplicable and horribly time consuming BS (for lack of a better term) QTP throws at us for no good reason at all.

Thank you for an excellent post!
Left by Mike Weiner on Jul 21, 2011 4:45 PM

# re: Why does QTP lose its mind?
Requesting Gravatar...
Hi,

Thank you so much for the knowledgeable post, I exactly have similar problem.

when I searched for .bat files there are a bunch of them..could you please help me identify them?

I am using the latest version QTP 11


Your help is greatly appreciated!

Thanks,SP
Left by sunitha on Aug 11, 2011 3:10 PM

# re: Why does QTP lose its mind?
Requesting Gravatar...
I know i'm a bit late on this comment, but I had the same issues. One day QTP was not recognizing items .. objects were confused and I was too (haha). I am curious to as what ended up happening with your ordeal?

I ended up finding an alternative to QTP, because I did not have time for these internal issues. I ended up testing out "TestComplete" from http://breakfreefromhp.com/ and I was happier with results. I was able to get work done quicker and nothing was forgotten :)

I am interested in hearing your story - email me!

Maria
Left by Maria on Jan 24, 2012 4:00 PM

# re: Why does QTP lose its mind?
Requesting Gravatar...
Yeah, and still further QTP madness; I was running a script with a poorly designed and written Web/Win application. If I F11 (step through) the script it finds the problem link with no issues. If I run the test, the first 2 or 3 or maybe 4 iterations QTP cannot find the link then on the next test iteration it does. I have tried slowing the script down with sync points, wait statements and the like. I ever built a for loop that looks for the link and then tries to click it 20 times with an if statement that exits the loop if it finds the link. Still QTP seems to need a warm up for 2 or 3 or 4 test iterations before it can find the link. Does anyone know the method to get QTP "stretch" before a test run?
Left by qatestbrian on Feb 22, 2012 9:02 AM

Your comment:
 (will show your gravatar)


Copyright © Maryanne Sweat | Powered by: GeeksWithBlogs.net