Archive for ldtp.myfastforum.org Linux Desktop Testing Project - http://ldtp.freedesktop.org
 



       ldtp.myfastforum.org Forum Index -> LDTP Test scripts (http://ldtp.freedesktop.org)
nagappan

Exception handling

Its 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

       ldtp.myfastforum.org Forum Index -> LDTP Test scripts (http://ldtp.freedesktop.org)
Page 1 of 1
Create your own free forum | Buy a domain to use with your forum
Linux Desktop Testing Project - http://ldtp.freedesktop.org