Micro Focus QTP (UFT) Forums
Error 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Error Recovery Scenario (/Thread-Error-Recovery-Scenario)



Error Recovery Scenario - vamshiram - 07-23-2008

Hi All

I am running some iteration on the application

I created Error recovery scenario for Test run any error..

I am calling a function.which is taking the screenshot of the error, and closing the error window and keeping the appllication at same place where the first itteration starts, and i selected post recovery is next test iteration.

I am using for loop for iteration.

if any error occurs the error recovery scenario opens and as per the functionality it is doing the steps and it is stoping the test.

It is nt picking the next iteration.....

can any one gve me a solution

Vamshiram


RE: Error Recovery Scenario - navitha123 - 07-23-2008

Hi Vamshi,

I created one subroutine instead of Recovery scenario.I am calling that subroutine when each and every action is completed.If the action is correct then only it goes to next step otherwise it exits from the action and test itself.

Here is the sloution:

Code:
Sub ActionOnError(errNumber, errDesc)
   If errNumber <> 0  Then
        Reporter.ReportEvent micFail,"Login",errDesc
        ExitAction(0)
    End If  
End Sub

Sub ActionOnSuccess
        Reporter.ReportEvent micPass,"Login","Login Processed Successfully"
        ExitAction(1)
End Sub

Call this subroutine in each action.

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

Please let me know if you find any issues.


Thanks
Navitha.


RE: Error Recovery Scenario - navyasatish - 07-24-2008

hello navitha,

take a scenario where we don't know what kind of exception will be thrown where...
if the QTP script is big enough then the script may contain too many call statements right (if i am not wrong in my understanding)...

also i tried this method but did n't do any action and it got stucked where the run error pop up window was thrown.

--->
i have followed the similar kind of procedure what vamshi has followed i.e created a recovery scenario which should be called on any error. on anykind of error,this function should be called and send a message saying process has been failed and should quit the test run itself.

when success,i am getting message but on failure nothing was happening and error will be thrown and error pop up window will be like that.

i found while adding a recovery scenario... i might have made mistake can anyone guide me in this ...

procedure i followed
recovery--> recovery scenario manager --> Trigger event = Test Run Error --> on any error --> function call -->
what should function library : and select function should contain .... ?

i am having function library as Tongue:\Technology\Quality Assurance\QTP \scripts\FunctionFailedScript.qfl
by using browse opetion... it's taking whole path and file name ..
and what should either function library or select function should contain??
on completion of these steps i am viweing the path as H:\Technology\Quality Assurance\QTP \FunctionFailedScript.qfl::FunctionFailedScript.qfl

please correct me how to add a function correctly

Thanks
Navya


RE: Error Recovery Scenario - vamshiram - 07-25-2008

Hi All

Thank you very much navitha and Navya...

Navitha
the way yoyr handling is correct, But when ever u r action fails the test is alspo gng to fail? I wl explain my problem

Simple example
Code:
Browser("Login").page("Login").webedit("UN").Set Datatable("UN","LoginSheet")
Browser("Login").page("Login").webedit("PWD").Set Datatable("PWD","LoginSheet")
Browser("Login").page("Login").WebButton("OK").click

If Login Fails

(NO popups) the Browser and page names changes to ErrorBrowser and Error pageare and a error message is displayed on the page, SO i called a recovery scenario and added a function

which take a screenshot of the browser and palce the browser in to it's normal stage (Login stage) to run the next itteration.

So when the error recovery scenario triggers it calling the function and it executing the steps,after that insted of picking the next row the test is stoped.


how can I force the QTP to go for the next iteration, and i tried with all post recovery scenarios.

Navya

recovery--> recovery scenario manager --> Trigger event = Test Run Error --> on any error --> function call -->

Functional library is .vbs file , This can be used for writing user defined functions. For error recovery when ever u calls a function u need write the library function in a specific format like as follows


Code:
Function TestRunErrorRecoveryFunction(Object, Method, Arguments, retVal)
            
Browser("name:=.{1,200}").close

Systemutil.Run "http://newtours.demoaut.com/mercurywelcome.php", IE

Datatable.getsheet("TestExample").SetNextRow
End Function



Vamshi


RE: Error Recovery Scenario - navyasatish - 08-01-2008

Hello vamshiram,

Thanks for reply .... but i am still facing the problem...
in the recovery Operation - Function Call window...
Function Library:
Select function:
Define new function:

should FunctionLibrary only contains a path (or) including function too

i tried to enter only Path and tried to define a new function so that i can save this function as .vbs and include this recovery scenario manager in the main script ... but not able to define a new function by giving a path..

i am not able to enter the path only with out including function name near the function library .
finally again same problem...after a selcting the function library and any one of define new function/select function .. like i am getting the path as ... H:\Technology\Quality Assurance\QTP \FunctionFailedScript.vbs::FunctionFailedScript.vbs

pls help me out in this..

Thanks
Navya


RE: Error Recovery Scenario - vamshiram - 08-18-2008

HI

I am sorry for very late reply.

I am attaching a doc which explain you how a errror recovery function should add. I taken the screen shot of the process.

If still u have any problem pls send me a mail i wl help u //

ram.vamshi@gmail.com


RE: Error Recovery Scenario - sucheta - 08-04-2017

(08-18-2008, 04:26 PM)vamshiram Wrote: HI

I am sorry for very late reply.

I am attaching a doc which explain you  how a errror recovery function should add. I taken the screen shot of the process.

If still u have any problem pls send me a mail i wl help u //

ram.vamshi@gmail.com

HI ,

how to access the file as i can't access it,it takes me to different page which is confusing.

Could you plz guide me to it?
Than,
sucheta