Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need Recoveries to handle Run Time Errors
#1
Not Solved
I need a Recovery for the following scenario.(I am using QTP 9.2)

I have a Main VBS function in which I am calling 3 other VBS Functions within the For statement. Please see the sample code below

Code:
Public Function Main()
---
  For i = 1 to 10

   Fun1()
   Fun2()
   Fun3()

  Next

End Function

I am executing this script for "Web" Application and think for the first four iterations execution is successful, and in fifth iteration(i=5) I got a Run Time error in Fun2() which stopped the execution.

I want a Recovery for these kind of run time errors. Here I have two options I want to handle

Opt 1: Stop the Iteration(in this case 5th iteration) when the Run Error comes -> Close the Application -> Start next Iteration(6th)

Opt 2: Stop the execution of Function(Fun2()) only in which we got Run Error and continue execution of Fun3() for the Fifth iteration.

NOTE: Run Test Setting of 'Data Table Iterations' option should be 'Run One Iteration only' in this case.

Could you Please share your ideas in these kind of scenarios.? And if you want to suggest any other Recoveies in the above scenario please share.

Thanks,
Vijay
Reply
#2
Not Solved
Try if GetNextRow or SetNextrow in the datatable helps in this situation.
Reply
#3
Not Solved
I got some information on this. I am capturing Run TIme Error number in a global variable from 'Err.Number' and Validating this with IF Condition (If Err.Number<>0) and exiting the funciton based on the Err.Number value.

As I don't want my script to stop, I am using 'On Error Resume Next' statement in each function and every function.

Drawback with this is If we use any Recoveries(.qrs) then Err.Number automatically sets to a number when ever Recoviries are called.

Vijay
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Loading QRS files at Run time dvkbabu 2 10,038 03-24-2017, 09:04 PM
Last Post: UrmilaSaha
  Test Director Errors Autobot 0 1,778 10-23-2015, 10:21 AM
Last Post: Autobot
  Missing Resources, Information Pane, Debug Viewer, Run time Data Table not visible Aurodeepta 3 6,994 05-28-2015, 02:52 PM
Last Post: Aurodeepta
  Object Identification not working on Run Time Ajatshatru 2 3,275 05-06-2015, 07:27 PM
Last Post: Ajatshatru
  Error while adding Object to Object repository at run time SaranKumarV 3 8,665 02-02-2015, 01:40 AM
Last Post: dubeyvin

Forum Jump:


Users browsing this thread: 1 Guest(s)