Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error Recovery Scenario
#1
Solved: 11 Years, 4 Months, 3 Weeks ago
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
Reply
#2
Solved: 11 Years, 4 Months, 3 Weeks ago
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.
Reply
#3
Solved: 11 Years, 4 Months, 3 Weeks ago
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
Reply
#4
Solved: 11 Years, 4 Months, 3 Weeks ago
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
Reply
#5
Solved: 11 Years, 4 Months, 3 Weeks ago
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
Reply
#6
Solved: 11 Years, 4 Months, 3 Weeks ago
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


Attached Files
.doc   ErrorRecovery.doc (Size: 944 KB / Downloads: 249)
Reply
#7
Solved: 11 Years, 4 Months, 3 Weeks ago
(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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Not Able to Identify Object during Recovery Scenario Phani 2 3,417 01-25-2016, 01:26 PM
Last Post: arunshuklainbox
  Recovery scenario for Certificate Error: Continue to this website SaiJyothsana 3 5,197 07-05-2011, 07:33 PM
Last Post: rajpes
  Move to next iteration of for loop after Recovery scenario zoomintodepth 0 5,130 01-28-2011, 01:13 PM
Last Post: zoomintodepth
  Secure QTP Code and Error Handling Scenario. knarravu 0 4,226 11-02-2010, 12:40 AM
Last Post: knarravu
  Recovery Scenario and Error Statements sunny rao 0 1,926 01-08-2009, 07:43 PM
Last Post: sunny rao

Forum Jump:


Users browsing this thread: 1 Guest(s)