background image
<< Multi-Application - Concurrency test explained | Multi-Application - rendezvous statement >>
Multi-Application - the multitestcase keyword
<< Multi-Application - Concurrency test explained | Multi-Application - rendezvous statement >>
392
User's Guide
22 M
ULTI
-A
PPLICATION
T
ESTING
Concurrency test explained
The first line of the testcase file defines the timeout value (in seconds) to be
used while waiting for a window to appear.
multitestcase MyTest (LIST OF STRING lsMachine)
The testcase function declaration starts with the multitestcase keyword. It
specifies a
LIST OF STRING
argument that contains the machine names for
the set of client machines to be tested. You can implement and maintain this
list in your testplan (using QA Organizer). The machine names you use in
this list are your target machines' Agent names. See Chapter 20,
"Configuring SilkTest for Client/Server Testing" wh
ich provides platform-
specific instructions for determining Agent names.
for each sMachine in lsMachine
SetUpMachine (sMachine, Personnel)
To prepare your client machines for testing, you must connect SilkTest to
each Agent and, by means of the Agent, bring up the application on each
machine. In this example, all Agents are running the same software and so all
have the same MainWin declaration and therefore just one test frame file.
This means you can initialize all your machines the same way; for each
machine being tested, you pass SetUpMachine the main window name you
specified in your test frame file. The SetUpMachine function issues a
Connect call for each machine. It associates the main window name you
specified (Personnel) with each machine so that the DefaultBaseState
function can subsequently retrieve it.
SetMultiAppStates ()
The SetMultiAppStates function reads the information associated with each
machine to determine whether the machine needs to be set to an application
state. In this case no application state was specified (it would have been a
third argument for SetUpMachine). Therefore, SetMultiAppStates calls the
DefaultBaseState function for each machine. In this example,
DefaultBaseState drives the Agent for each machine to open the main
window of the Personnel application. This application is then active on the
client machine and 4Test can send testcase statements to the Agent to drive
application operations.
for each sMachine in lsMachine
spawn
// The code to be executed in parallel by
// all machines... (described below)
rendezvous
Because this is a concurrency test, you want all client applications to execute
the test at exactly the same time. The spawn statement starts an execution
thread in which each statement in the indented code block runs in parallel