jmassey
10 years agoContributor
How to catch (or pre-catch) Item Not Found errors?
For some reason, try: ... except: ... does not seem to work on errors about an object not being found, e.g. (Python):
try:
Aliases.MyApp.MainFormBase.UltraToolbarsDockArea.ClickItem('Tab|Group|Nonexistent Button')
except Exception:
Log.Message('Hello, World!')The error message never gets logged, for some reason, though try-except seems to work fine in other scripts / situations. Is there something else I need to do to catch errors here? Or is there some way I can 'pre-check' if an item is findable before trying to click on it, and if it's not, handle the problem intelligently? I really use / rely on 'Stop On Error', but I need to not have this particular problem always (usually, yes, just not in some cases) result in the test halting.