background image
<< Client/Server - Concurrent programming issues | Client/Server - the Edit.FindChange menu item >>
Client/Server - Recovering multiple tests
<< Client/Server - Concurrent programming issues | Client/Server - the Edit.FindChange menu item >>
348
User's Guide
19 I
NTRODUCTION
TO
C
LIENT
/S
ERVER
T
ESTING
Concurrent programming issues
multi-machine test configuration. Be sure you are familiar with the
principles in the chapter on structuring and generalizing recordings
in this manual.
Driving multiple
machines
When you want to run tests on multiple machines simultaneously, you
connect to all the machines and then you direct specific test operations to
particular machines. This enables you to drive different applications
concurrently. For example, you can test the intercommunication capabilities
of two different applications or you can drive both a client application and its
server.
To do this, at the beginning of a test script you issue for each machine an
explicit connection command. This can be either Connect (agent_name) or
SetUpMachine (agent_name). This connection lasts for the duration of the
script unless you issue a Disconnect (agent_name) command. In the body of
the script you can specify that a particular portion of code is to be executed
on a particular machine. The SetMachine (agent_name) command specifies
that the following statements are directed to that Agent. You can specify that
just one statement is directed to a particular Agent by using the bracket form
of the machine handle operator. For example:
["Client_A"]SYS_SetDir ("c:\mydir")
Please refer to the machine handle entry in the 4Test Language Reference for
a detailed description of the machine handle operator.
Since 4Test allows you to pass variables to these functions, you can write a
block of code that sends the same operations to a particular set of target
machines and you can pass the SetMachine function in that block of code a
variable initialized from a list that specifies the machines in that set. Thus
specifying which machines receive which operations is very simple. Chapter
22, "Multi-Application Testing" gi
ves examples and detailed explanations of
these techniques.
Recovering multiple
tests
There are three major categories of operations that an Agent executes on a
target machine:
·
Setup operations that bring the application to the state from which the
next test will start.
·
Testing operations that exercise a portion of the application and verify
that it executed correctly.
·
Cleanup operations that handle the normal completion of a test plus the
case where the test failed and the application is left in an indeterminate
state. In either case, the cleanup operations return the application to a
known base state.