Hardy
8 years agoOccasional Contributor
Why except block won't executed when an error occurs within try block?
I am testing window application, and use try...except...finally to catch errors during run script test. But now it won't execute except block when an error occurs within try block, please refer to attached scripts and screenshot for more details.
Hi,
As far as i know, This expected behavior only. The errors coming from test are not actually a exception hence it will not throw a run-time error.
Some of the errors are not part of RunTime error
- Object Not Found
- Unable to Recognize the Image on the Current Desktop
- Search for a Mapped Object Took Too Much Time
- The test run has stopped because the Stop on Error (Warning) setting is enabled
- Incomplete Keyboard Input
- There was an attempt to perform an action at point...
- The window is invisible and thus cannot be activated
- and more..
Basically, Python or any other language can't capture some of the Test Complete Playback errors.
More details: https://support.smartbear.com/testcomplete/docs/testing-with/running/handling-errors/index.html
Some related topics: