The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:




Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Testing Tools >> HP Functional Testing / Mercury QuickTest Pro / QTP

Pages: 1
Starkal
Newbie


Reged: 10/20/10
Posts: 10
QTP encountered user defined breakpoint error
      #648327 - 11/10/10 04:08 AM

We're running our QTP 10.0 scripts designed for our Web application on IE 6.0 from QC 9.0 & facing the error to some of our scripts "QTP encountered user defined breakpoint error".

We're using Mercury.Objectrepositoryutil to identify the objects through its logical name there by avoiding the parent-child structure.All the steps in the script are executed succesfully & while creating the Results it throws this error & system hangs. Looked at the report generated in the Temp file which is incomplete, the XML report had an error 'Cannot view XML using XSL style sheet & some tags are not closed'.

Has anyone faced this error? Any suggestions please...


Post Extras: Print Post   Remind Me!   Notify Moderator  
Tarun LalwaniModerator
Veteran


Reged: 07/21/05
Posts: 15329
Loc: Milwaukee, Wisconsin
Re: QTP encountered user defined breakpoint error [Re: Starkal]
      #648379 - 11/10/10 07:20 AM

To be honest you should not use this approach. The ObjectRepositoryUtil is very buggy and create a lot of crashes for no reason. You should instead look at using the XML format OR

--------------------
Regards,
Tarun
** First ever technical novel - And I thought I knew QTP! **
** Download QTP Unplugged 2nd Edition eBook for FREE **

KnowledgeInbox RSS


Post Extras: Print Post   Remind Me!   Notify Moderator  
ttguy
Member


Reged: 01/28/09
Posts: 267
Loc: Canberra
Re: QTP encountered user defined breakpoint error [Re: Starkal]
      #648446 - 11/10/10 08:35 PM

Yes I sometimes get this error. And it is caused by the use of the Mercury.Objectrepositoryutil object

I have managed to avoid this problem if I ensure that any Mercury.Objectrepositoryutil object that I instansiate is released from memory as the last step that the test does.

My tests populate a gblObjectRepositoryUtil global variable and the last action in my test is
Code:
 set gblObjectRepositoryUtil  = Nothing



I find if my test stops before exectuing this line then QTP will hang and you will not be able to read any of the results. But if this line does execute things will be fine.

Like Tarun I was thinking about using the XML formated repository option for dealing with repository data. But it would mean me building a heap of functionality around it. So I currently use the Mercury.Objectrepositoryutil object and just deal with its idosyncracies.

Tarun - do you have a function library that could do stuff like "get a collection of all the objects in the repostitory that are children of <pObject>"? Cause this is the sort of thing I do with the Mercury.Objectrepositoryutil object


Post Extras: Print Post   Remind Me!   Notify Moderator  
Tarun LalwaniModerator
Veteran


Reged: 07/21/05
Posts: 15329
Loc: Milwaukee, Wisconsin
Re: QTP encountered user defined breakpoint error [Re: ttguy]
      #648448 - 11/10/10 09:03 PM

No i don't have it. The only reason being we can't load XML rep in memory. So everytime we create a TSR the XML also needs to be updated. That is why I avoid both these approaches

--------------------
Regards,
Tarun
** First ever technical novel - And I thought I knew QTP! **
** Download QTP Unplugged 2nd Edition eBook for FREE **

KnowledgeInbox RSS


Post Extras: Print Post   Remind Me!   Notify Moderator  
Starkal
Newbie


Reged: 10/20/10
Posts: 10
Re: QTP encountered user defined breakpoint error [Re: Tarun Lalwani]
      #648481 - 11/11/10 02:23 AM

Yes, ttguy got it exactly right. This error is displayed if ORutil object is not released properly. Not sure how to fix this but adding wait statements before this step has given better results although i'm still facing this error randomly.

How to use XML format OR? Tarun can you please explain.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Tarun LalwaniModerator
Veteran


Reged: 07/21/05
Posts: 15329
Loc: Milwaukee, Wisconsin
Re: QTP encountered user defined breakpoint error [Re: Starkal]
      #648495 - 11/11/10 03:57 AM

ttguy, Actually you can use a workaround to the issue

Code:

Dim gblObjectRepositoryUtil
Class ORUtil
Sub Class_Initialize()
Set gblObjectRepositoryUtil = CreateObject("Mercury.ObjectRepositoryUtil")
End Sub

Sub Class_Terminate()
Set gblObjectRepositoryUtil = Nothing
End Sub
End Class

Set oORUtil = new ORUtil



Starkal, You can use XMLUtil or Microsoft XML DOM to read the XML and then do whatever you want. You can give a object name and find all hierarchies where the object exists. Or you can get childobjects in OR for a given node etc...

--------------------
Regards,
Tarun
** First ever technical novel - And I thought I knew QTP! **
** Download QTP Unplugged 2nd Edition eBook for FREE **

KnowledgeInbox RSS


Post Extras: Print Post   Remind Me!   Notify Moderator  
Starkal
Newbie


Reged: 10/20/10
Posts: 10
Re: QTP encountered user defined breakpoint error [Re: Tarun Lalwani]
      #648533 - 11/11/10 09:08 AM

We actually use the same class_terminate to release the ORutil object. Strangely when this error happens, it fails to create the results although all the steps in the script are executed successfully.

Any workaround you think of other than XML as we have a large suite & changing it would be difficult right?


Post Extras: Print Post   Remind Me!   Notify Moderator  
ttguy
Member


Reged: 01/28/09
Posts: 267
Loc: Canberra
Re: QTP encountered user defined breakpoint error [Re: Tarun Lalwani]
      #648554 - 11/11/10 06:54 PM

Quote:

ttguy, Actually you can use a workaround to the issue

Code:

Dim gblObjectRepositoryUtil
Class ORUtil
Sub Class_Initialize()
Set gblObjectRepositoryUtil = CreateObject("Mercury.ObjectRepositoryUtil")
End Sub

Sub Class_Terminate()
Set gblObjectRepositoryUtil = Nothing
End Sub
End Class

Set oORUtil = new ORUtil








Tarun ,

I am not sure I am using your workaround correctly. Because for me it does not solve anything.
1. I declare a oORUtil globally in a function library.
2. I also declare gblObjectRepositoryUtil globally in a function library.

3. From a test action I call a function I call OpenRepositoryUtil which does
Code:
 
Set oORUtil = new ORUtil ' Instead of set gblObjectRepositoryUtil = CreateObject("Mercury.ObjectRepositoryUtil") which is what it used to do

gblObjectRepositoryUtil.Load "C:\Blah\Repository.tsr"



where the Class ORUtil is the code you posted

4. I make use of my gblObjectRepositoryUtil object doing things like getting child objects from parent objects etc

5. Normally the last thing my test would do is
Code:

set gblObjectRepositoryUtil = Nothing


And if I don't do this my test never completes.
But using your workaround as I describe here I still have the test fail to finish unless I do a
Code:

set oORUtil = Nothing


as the last step.

In addition if the test stops before executing the set oORUtil = Nothing then I need to use task manager to stop QTP. So this is identicle behaviour to my code before trying to implement your workaround.

But maybe I am doing it wrong.

It seems to me that Class_Terminate() on the ORUtil object does not execute when the test finishes. You have to explicity make it execute by doing set oORUtil = Nothing

Where am I going wrong?


Post Extras: Print Post   Remind Me!   Notify Moderator  
Tarun LalwaniModerator
Veteran


Reged: 07/21/05
Posts: 15329
Loc: Milwaukee, Wisconsin
Re: QTP encountered user defined breakpoint error [Re: ttguy]
      #648562 - 11/11/10 09:49 PM

Try keep the line

Set oORUtil = new ORUtil

Also in your associate library file and see if it helps. Also if that doesn't work then try this

Code:

Class ORUtil
Dim ORM

Sub Class_Initialize()
Set ORM = CreateObject("Mercury.ObjectRepositoryUtil")
End Sub

Sub Class_Terminate()
Set ORM = Nothing
End Sub
End Class

Set oORUtil = new ORUtil



In the code use "oORUtil.ORM." instead of gblObjectRepositoryUtil. See if that helps

--------------------
Regards,
Tarun
** First ever technical novel - And I thought I knew QTP! **
** Download QTP Unplugged 2nd Edition eBook for FREE **

KnowledgeInbox RSS


Post Extras: Print Post   Remind Me!   Notify Moderator  
ttguy
Member


Reged: 01/28/09
Posts: 267
Loc: Canberra
Re: QTP encountered user defined breakpoint error [Re: Tarun Lalwani]
      #649724 - 11/22/10 10:38 PM

Ok so I have tried a few things. But none have got me the solution.

My inital try was
Code:
  
' in attatched library file X:\QTP\Common\QC_Util_lib.qfl
Dim gblObjectRepositoryUtil
Dim oORUtil


Class ORUtil
Sub Class_Initialize()
Set gblObjectRepositoryUtil = CreateObject("Mercury.ObjectRepositoryUtil")
End Sub
Sub Class_Terminate() ' This executes when a ORUtil object is not referenced any more.

Set gblObjectRepositoryUtil = Nothing
End Sub
End Class


public Function OpenRepositoryUtil (pRepositoryName)





Set oORUtil = new ORUtil ' This causes Class_Initialize() to run and create the gblObjectRepositoryUtil
gblObjectRepositoryUtil.Load pRepositoryName ' can load into the gblObjectRepositoryUtil

end function


The Main test calls OpenRepositoryUtil
and I can subsequently use the gblObjectRepositoryUtil object. But test dies unless the test gets to execute set oORUtil = Nothing

Tarun followed up with a suggestion which is very simlar to my first go except that Set oORUtil = new ORUtil is done in global section not inside OpenRepositoryUtil
I implemented this as follows:
Code:
  
' in attatched library file X:\QTP\Common\QC_Util_lib.qfl
Dim gblObjectRepositoryUtil
Dim oORUtil


Class ORUtil
Sub Class_Initialize()
Set gblObjectRepositoryUtil = CreateObject("Mercury.ObjectRepositoryUtil")
End Sub
Sub Class_Terminate() ' This executes when a ORUtil object is not referenced any more.

Set gblObjectRepositoryUtil = Nothing
End Sub
End Class

' Globally set this
Set oORUtil = new ORUtil ' This causes Class_Initialize() to run and create the gblObjectRepositoryUtil


public Function OpenRepositoryUtil (pRepositoryName)


gblObjectRepositoryUtil.Load pRepositoryName ' can load into the gblObjectRepositoryUtil


end function



Main test calls OpenRepositoryUtil
I can subsequently use the gblObjectRepositoryUtil object. But again test dies unless the test gets to execute set oORUtil = Nothing

Tarun had another suggestion which I implemented as follows:

Code:
  
' in attatched library file X:\QTP\Common\QC_Util_lib.qfl

Dim oORUtil
' No gblObjectRepositoryUtil is delcared



Class ORUtil
Dim ORM
Sub Class_Initialize()
Set ORM = CreateObject("Mercury.ObjectRepositoryUtil")
End Sub
Sub Class_Terminate()
Set ORM = Nothing
End Sub
End Class
Set oORUtil = new ORUtil


public Function OpenRepositoryUtil (pRepositoryName)
oORUtil.ORM.Load pRepositoryName ' this works to load into the oORUtil.ORM Mercury.ObjectRepositoryUtil object


end function




Main test calls OpenRepositoryUtil

In the rest of the code I use "oORUtil.ORM." instead of gblObjectRepositoryUtil. And I can access the Mercury.ObjectRepositoryUtil contained therein.

But still - if my test stops because of an error - QTP still thinks it is running and I can only stop QTP using Task Manager.
So I don't seem to be able to get Class_Terminate to run when the test is stopped before execution completion.

So unfortunately none of Taruns suggestions have got me very far. Which is because I got all exicited about being able to beat this bug. Because it is the bane of my existance having to restart QTP from task manager on a frequent basis.

Tarun, have you experienced this sort of fix working or have you offered these suggestions from a theoretical standpoint?

I am happy to try any other ideas you might have.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Starkal
Newbie


Reged: 10/20/10
Posts: 10
Re: QTP encountered user defined breakpoint error [Re: ttguy]
      #649761 - 11/23/10 03:57 AM

We've followed very similar approach but couldn't get out of this error.

Our approach is:
Storing the Path for all the Objects during Script start up into a Recordset & for each step we create reference to object from recordset.

When i tried running this utility alone from QTP as vbs script, it still got closed with an error 'QTP has encountered an error & need to be closed.'

Can you try raising a ticket with HP for this.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 109 anonymous users are browsing this forum.

Moderator:  IanFraser, Rajkumar_Rajangam, thorwath, TReddy, AJ, Tarun Lalwani, mwsrosso 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 4207

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5