Training Test Automation Scripts for Dynamic Combat: Self Defense

Part III

Input "JPass" into Password textbox


Click Login button


If "Login Error" dialog exists then


          Click Ok button


          Log Error


          Abort the test


End If

Figure 1: Localized example of exception handling.

This example has some exception handling in steps four through eight. This example specifically looks for the anticipated "Login Error" dialog, handles it by clicking the OK button, and then aborts the test. The advantages to handling this error are: time is not wasted by continuing to execute a failed test; the report will be clean because only the main error will be logged; and the following tests will not be adversely affected.

Another approach to handling this error is to use exceptions and a separate error handler, as seen in figure 2.


Input "John"
into Username textbox


Input "JPass"
into Password textbox


Click Login


scrVar = Verify
"Welcome Screen" exists


If scrVar Not
Equal to "Pass" then


scrVar to Exception Handler


End If

Figure 2: Passing to error handler.

This example reveals how an exception handler may be introduced. An error code is received from a verification point (line four), then the error code is sent to an error handler in the event that the code is not a "Pass." The exception handler will be responsible for executing exception code similar to what is shown in figure 1, in addition to handling other types of errors that may occur.

Stay tuned for Part IV of the Taekwondo-mation series, in which I will explore the principle of Strikes (Dynamic-path handling).

Read Training Test Automation Scripts for Dynamic Combat: Flexibility  - Part I
Read Training Test Automation Scripts for Dynamic Combat: Balance  - Part II
Read Training Test Automation Scripts for Dynamic Combat: Strikes  - Part IV

About the author

Dion Johnson's picture Dion Johnson

As a senior test consultant and managing partner for DiJohn IC, Inc. and advisor to the Automated Testing Institute, Dion Johnson provides IT consulting services that focus on the overall system development lifecycle, with particular focus on the quality assurance, quality control, requirements analysis, and automated testing. He has presented at numerous SQE conferences and contributed to and Better Software magazine. In addition he is an editor for the Automated Software Testing magazine. Email Dion at or

AgileConnection is one of the growing communities of the TechWell network.

Featuring fresh, insightful stories, is the place to go for what is happening in software development and delivery.  Join the conversation now!