O'Reilly logo

Just Enough Software Test Automation by Bruce A. Posey, Daniel J. Mosley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Keep Your Code Clean and Robust

Your code should be fairly robust, meaning that it should account for the unexpected and always allow for orderly termination when errors do occur. Notice the Select Case statement in our example in the previous section. These three lines of simple code alert the tester that an unknown window code was read either because a new case statement has not yet been added to accommodate it or because a bad code found its way into the test data.

When using called procedures and functions, always construct it so that a return code is made available to the caller. This alerts the caller that either the function/procedure was successful, or failed, and allows for proper action to be taken.

Now that the window is selected, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required