GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Testing Tools  >  QTP
Go To First  |  Previous Question  |  Next Question 
 QTP  |  Question 52 of 691    Print  
How to instruct QTP to display errors and ther description in the test results instead of halting execution by throwing error in the mid of execution due to an error(for example Object not found)?

  
Total Answers and Comments: 10 Last Update: November 22, 2007     Asked by: Ram 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: Wasim
 

Make use of Reporter.Reportevent eg.

var=statement

if var="True" Then

Reporter.Reportevent 0,"Step Name","Description of the Passed step"

else

Reporter.Reportevent 1,"Step Name","Description for the failed step"

End If

I hope thats it :)



Above answer was rated as good by the following members:
Ritik1008
October 21, 2005 08:33:09   
Pradeep        

RE: How to instruct QTP to display errors and ther des...

Hi

Use Recovery senarios to accomplish that.


 
Is this answer useful? Yes | No
October 26, 2005 04:42:30   
Santaji Nanavare        

RE: How to instruct QTP to display errors and ther des...
Use Exception Handling technique of QTP: can be achieved by any one of the following two methods:1. Using Recovery Scenario Manager2. scripting by using :if-else-then OR Select Case
 
Is this answer useful? Yes | No
October 28, 2005 11:35:57   
Imrana        

RE: How to instruct QTP to display errors and ther des...
I have the same problem. However My issue deals with waiting for an object. I'm not a programmer. How can I manipulate the Wait function to wait without me having to specify the seconds. For instance in Rational Functional Tester I used to use wait.untilExistence.
 
Is this answer useful? Yes | No
November 10, 2005 15:46:58   
Wasim Member Since: November 2005   Contribution: 10    

RE: How to instruct QTP to display errors and ther des...

Make use of Reporter.Reportevent eg.

var statement

if var True Then

Reporter.Reportevent 0 Step Name Description of the Passed step

else

Reporter.Reportevent 1 Step Name Description for the failed step

End If

I hope thats it :)


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
January 17, 2006 09:00:34   
Mercy        

RE: How to instruct QTP to display errors and ther des...

How to instruct QTP to display errors and ther description in the test results instead of halting execution by throwing error in the mid of execution due to an error(for example Object not found)?

For all of u who've added their comments to this questions i request u read the question once more very carefully.

It clearly demands that the script should not halt in between the execution if any error occurs. In this case the only solution is to use Optional Step statement. Using this statement QTP will reflect a Warning message in the Test Results Page and just continues running the next line of the script. Please refer QTP help for more information on this.




 
Is this answer useful? Yes | No
January 17, 2006 09:08:32   
angiemercy1 Member Since: January 2006   Contribution: 2    

RE: How to instruct QTP to display errors and ther des...
The Solution is Optional Step statement. For more see QTP help.
 
Is this answer useful? Yes | No
January 28, 2006 04:35:06   
saurabhdeswaltavant Member Since: December 2005   Contribution: 10    

RE: How to instruct QTP to display errors and ther des...

One option is to use 'On error resume next' and get the err.description

in the Reporter.reportEvent 4 Error if any err.description

Second option is to ask the Recovery manager to look err.description for every executed step and log them in a flat file.

Vinoth.


 
Is this answer useful? Yes | No
September 30, 2006 17:59:20   
Deepak Kumar        

RE: How to instruct QTP to display errors and ther des...

'I use the following code to wait for the java report object to get loaded before validation of the report can start:

Report Browser.Page.Frame.JavaApplet.JavaObject.Object

Do

Until (Browser.Page.Frame.JavaApplet.JavaObject.Object.Exist

' Let me know if this code slows down the application run speed. I have an alternative code to use as well. Thanks.


 
Is this answer useful? Yes | No
April 09, 2007 12:49:11   
sri        

RE: How to instruct QTP to display errors and ther des...
There is a option Test->settings->goto RUN tab select proceed to next step in when error occurs during run session. Then u will escape fromthe error without doing any programming.
 
Is this answer useful? Yes | No
November 22, 2007 05:28:48   
Punitha.R Member Since: October 2007   Contribution: 39    

RE: How to instruct QTP to display errors and ther des...
Hi

I want to dispaly the error description and result value in the reporter event
i tried to display using this code

if cnt j then

reporter.reportevent 0 "Result Pass" &cnt & "Selected"

else

reporter.reportevent micfail "Result Fail" & j & "only selected"

end if

Here i want to display the some value mid of the two strings ]
how i display
Plz help me

Regards

Punitha.

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2010 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape