Forum Discussion
tristaanogre
11 years agoEsteemed Contributor
Log.ErrCount is a read-only value, I believe. You can't reset it via script so that's not going to work. What you probably should do is create your own counter as a project variable that you can increment in the OnLogError handler before your If/Then statement.
As for why the stuff coming AFTER the Stop Execution is not happening... I think it's because you are stopping execution. The OnLogError event handler "interrupts" the Log.Error process. So, when an error is logged, this takes over. In fact, Log.ErrCount does not increment until after the error handler completes.
So, when you hit that 9th error (Log.ErrCount=8), it hits the Stop Execution call... and then goes on to the next test item. I tried all this in TC 10.20. Screenshot below:
If you want that stuff to be executed on that 9th error, move it all to be BEFORE the Stop Execution call. That way it will execute as part of the event handler and then Stop Execution will "kill" the current test item and move on to the next one.
Hope this helps!
As for why the stuff coming AFTER the Stop Execution is not happening... I think it's because you are stopping execution. The OnLogError event handler "interrupts" the Log.Error process. So, when an error is logged, this takes over. In fact, Log.ErrCount does not increment until after the error handler completes.
So, when you hit that 9th error (Log.ErrCount=8), it hits the Stop Execution call... and then goes on to the next test item. I tried all this in TC 10.20. Screenshot below:
If you want that stuff to be executed on that 9th error, move it all to be BEFORE the Stop Execution call. That way it will execute as part of the event handler and then Stop Execution will "kill" the current test item and move on to the next one.
Hope this helps!
Related Content
- 8 years ago
Recent Discussions
- 7 hours ago