Monday, January 14, 2013

About Error Handling

Error Types in QTP
  1. Syntax error- use ctlr+F7 or view>error
  2. Logical error-
  3. Run time error- can handle in following way.
    1. Test Setting
    2. On error statement- on error resume next, on error go to 0
    3. using Err object - err.description, err.clear, err.source, err.helpcontext
    4. Recover scenario- use to handle unwanted popup, app crash, object stat, test run error etc
    5. Reporter object
    6. Exit statement -exittest, exitaction, exittestiteration


On Error Resume Next
  • Provide some degree of error handling by preventing program interuption from runtime error
  • When error occurs, by using it the line of code containing the error is skipped over and program continues. it doesn't correct the error just ignore it without even displaying error message
  • Turn off the script engine error checking: On error resume next
  • Turn On the script engine to stop execution of a script when an error is encountered: on error go to 0

No comments:

Post a Comment