Why except block won't executed when an error occurs within try block?
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.
Some related topics: