03-23-2009, 05:55 PM
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
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
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