What follows is a very simple and condensed illustration of functional test automation. Our sample application is a telephone directory lookup Web site, http://www.qwestdex.com. This is not intended as any type of endorsement; it simply provides a stable, public application with characteristics that enable us to illustrate the tests. We have found that spreadsheets are a convenient way to define and maintain test definitions. The test definitions for the example are shown in Table 38.2. These are the actual definitions of the tests, in which the parameters and expected results are encoded in a form that can be directly interpreted by the test modules. For simplicity, all validation of expected results has been specified as checks on the presence of text strings, but the framework also supports validating the presence and attributes of links, forms, and tables. The test modules are implemented using the WebART scripting language, and the Java framework can then be used to execute test definitions directly from the spreadsheet. The output from a test run is an HTML log file, as shown in Figure 38.1, that provides an overall pass/fail status for the test and individual outcomes on each test case. Figure 38.1. Output from the qwmain testsIt is possible to drill down to a particular test case by clicking the link for an individual test case. Figure 38.2 shows the GotoLogin case. Figure 38.2. Output from the GotoLogin test caseLikewise, it is possible to drill down to a particular validation, as shown in Figure 38.3. Figure 38.3. Validation output for GotoLogin
|