Micro Focus QTP (UFT) Forums
Query:Recovery Scenario - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Query:Recovery Scenario (/Thread-Query-Recovery-Scenario)



Query:Recovery Scenario - Rachna - 03-27-2009

Hello,

i have implemented Recovery scenario in my scripts in the following way:
Error handling on error

Code:
call ActionOnError (err.number, err.Description)

'Error handling on succes
Call ActionOnSuccess

Sub ActionOnSuccess
   reporter.ReportEvent 0,"Verifying that Action has rendered any error","NO,It is a SUCCESS"
End Sub

'Name:Recovery scenario subroutine
Sub ActionOnError(errNumber, errDesc)
If errNumber <> 0 Then
Reporter.ReportEvent micFail,"Login",errDesc
ExitAction(0)
End If
End Sub

is it the right way of error handling?also what should be the optimum Test settings in RUN tab for "When error occurs in run sessionTongueop-up message should appears,stop the run,proceed to next iteration.proceed to next step"
I am working on java (Windows base application) with QTP9.2 version.Should recovery scenarios be used instead of the above mentioned code snippet?
Please advise asap.

Regards,
Rachna


RE: Query:Recovery Scenario - Rachna - 03-30-2009

hi,

Would appreciate if anyone can repond to my query asap.

Warm Regards,
Rachna


RE: Query:Recovery Scenario - sreekanth chilam - 03-30-2009

hi rachana,

Infact as far as predictability of Errors are concerned, below are the 2 ways for proceeding:

1) For predictable Run Time Errors :

we should go for "On Error Resume next" & "Err" object

2) For Unpredictable Errors :

such as Third Party Pop ups(Printer Out of paper,etc..)
We should go for Recovery Scenario