Manfred_F
11 years agoRegular Contributor
deal with known errors
Hi experts,
how do You treat known Errors?
You don't want to stop test execution for them.
But You want to stop on unknown Errors, so the StopOnError Option must be active.
You could replace Log.Error by Log.Warning in the scripts and set StopOnWarning to False.
But this is not possible, if the Log.Error is located in a Standard function used for General purposes.
My solution is to replace Log.Error by Log.Warning dynamically in the OnLogError Event procedure. To tag an error as known, I set an object-type Option variable in my script before calling the errorprone line. The error can then correctly be replaced by a warning in the Event procedure. Then, in the script, I call the .Restore method of my option object (or simply wait until it is released when the script procedure is finished), and the next error can be logged as an error again.
Any other proposals?
Regards,
Manfred
how do You treat known Errors?
You don't want to stop test execution for them.
But You want to stop on unknown Errors, so the StopOnError Option must be active.
You could replace Log.Error by Log.Warning in the scripts and set StopOnWarning to False.
But this is not possible, if the Log.Error is located in a Standard function used for General purposes.
My solution is to replace Log.Error by Log.Warning dynamically in the OnLogError Event procedure. To tag an error as known, I set an object-type Option variable in my script before calling the errorprone line. The error can then correctly be replaced by a warning in the Event procedure. Then, in the script, I call the .Restore method of my option object (or simply wait until it is released when the script procedure is finished), and the next error can be logged as an error again.
Any other proposals?
Regards,
Manfred