SushantNfl
7 years agoOccasional Contributor
GeneralEvents_OnLogError Running Infinitely
The event handler GeneralEvents_OnLogError is getting executed recursively.
Scenario:
Have a collection of items for which 1 same process has to be performed.
But if there is any error thrown during the execution for any item, TestComplete should close and restart the application and continue the same process with the next item in the collection.
But the GeneralEvents_OnLogError gets executed infinitely if an error occurs.
Ideally script execution should end once the main is completely executed.
Kindly let me know what could be the possible root cause of the issue?
Thanks in advance!
Please find the sample code below.
indexValue = 0 list = [1,2,3,5,10,8]
def main(): launchApplication() while indexValue<len(list): performTask(list(indexValue)) indexValue = indexValue + 1 Log.Message("Process Completed") def GeneralEvents_OnLogError(Sender, LogParams): global indexValue indexValue= indexValue+ 1 CloseOpenApplcaition() main()