nagappan
|
Exception handlingIts always recommended to handle exception:
Script without exception handling
| Code: | click ("*-gedit", "btnFind") # Clicks find button in gedit window
|
Script with exception handling
| Code: | try:
click ("*-gedit", "btnFind") # Clicks find button in gedit window
except LdtpExecutionError, msg:
print "Failed", msg
raise LdtpExecutionError (str (msg))
|
Advantages of exception handling
Helpful for logging the cause for failure
|