One of the handy features of the Test Composer is that you can compose tests before you write the scripts that make up the test. Defining the JST files first can help you determine which scripts you need to write, whether they will be re-usable, and, later on, when you can re-use a test by adding parameters.
For this part of the lesson, you're going to use the Test Composer to compose three JavaStar Tests:
The first two tests represent the major areas covered by the script you wrote in the previous chapter. The last JST, the Acceptance test, combines the two previous tests with an OpenFile script. This creates a test that functions just like the long script, but is composed of modules you can re-use in other configurations.
You create the Acceptance test last because, while you can define a JST before you've written the scripts that it references, you can't reference another JST that hasn't yet been written.
This first JST handles record entry. As you noted when you reviewed the example earlier, this record entry portion of the script did three things:
Now you'll create a JST with a node for each of these operations.
JavaStar Test Composer
The blank panel in the middle/right area of the Test Composer window is the work area where you graphically define your test. The buttons along the left control the file and the nodes you create, while the fields above the work area are where you define general information about your test, and where you navigate to other JSTs.
ClearDisplay
as the name of your node..class
file by this name, so be precise. In this case, type ClearDisplay
and click OK.
Note - If you wanted to reference another JST file instead of a .class
file, you would need to use the .jst
extension.
EnterFieldData
and the other named Add
.ClearDisplay
is toward the top of the work area, with EnterFieldData
below ClearDisplay
and Add
below EnterFieldData
.
You can click and drag a node to re-position it.
ClearDisplay
to EnterFieldData
.
To create a normal connection:
ClearDisplay
node to select it. ClearDisplay
flashes to let you know an operation is in progress.
EnterFieldData
to select it as the end point.ClearDisplay
to EnterFieldData
.
EnterFieldData
to Add
.ClearDisplay
node.ClearDisplay
to select it, then click the Duplicate button in the left button panel.
ClearDisplay
node to a position below the Add
node.Add
to the second ClearDisplay
node.Adds 1 record to the database
.AddRecord.jst
The first node you created, ClearDisplay
, appears in blue to indicate that it is the root or starting node. This is the node that the test will execute first. You can change a root starting node by selecting another node and clicking the Set Root button.
AddRecord.jst.
This JST verifies that the name matches the record you added. In the TestNameDB
script you created in the previous chapter, you:
Because it's rare that you would perform a search and not select a record to view, this JST assumes you're combining these into one script, but leaving the rest of the steps as separate scripts.
OpenSearch
, DefineSearch
, GetSearchResults
, VerifyRecord
, and CloseSearch.
Searches for a record and verifies that the result is correct
.VerifySearch.jst
VerifySearch.jst
in the JST name field.
The script you wrote in the last chapter will be the model for this acceptance that draws all the test modules (the ones you have yet to write) together. This means the acceptance test needs to:
The steps for adding records and verifying the name are now already defined by other JSTs and only need to be referenced. For loading a file, you need to create a node for another script you'll write. ClearDisplay
is a script you've already referenced (but not yet written) in AddRecords.jst
, so you'll use the same name again.
To define the acceptance test:
OpenFile
as the test name and click OK.AddRecord.jst
as the test name.AddRecord.jst
, and click Open. Then click OK.
.class
file.
SaveDB
.VerifySearch.jst
..jst
extension or misspell the name, JavaStar won't find the file you want.
ClearDisplay
.CloseDB
.Simple acceptance test for Name Database
.Acceptance.jst
Acceptance.jst
.
Send feedback to
JavaStar-feedback@suntest.com
Copyright © 1998
Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, CA 94303.
All rights reserved.