background image
<< Multi-Application - template.t explained | Multi-Application - Code for concurrency test example >>
Multi-Application - GUI-based applications
<< Multi-Application - template.t explained | Multi-Application - Code for concurrency test example >>
388
User's Guide
22 M
ULTI
-A
PPLICATION
T
ESTING
template.t explained
The first argument for SetUpMachine is the machine name of one of your
client machines. The second argument is the name you supply in your main
window declaration in your test frame (frame.inc) file. For this example, the
frame.inc file specifies the following:
window MainWin MyFirstApp
Because this template specifies two different applications, it requires two
different test frame files.
The third argument is the name you provide for your application state
function in your appstate declaration for this test. For this example, the
appstate declaration is the following:
appstate MyFirstAppState () based on MyFirstBaseState
The appstate declaration could also be of the form:
appstate MyFirstBaseState ()
Although the DefaultBaseState function is designed to handle most types of
GUI-based applications, you may find that you need to define your own base
state. It would be the application state that all your tests for this application
use. In this case, you would still pass this application state to SetUpMachine
so that your application would always be brought to this state at the start of
each testcase.
This template specifies two application states for generality. You would not
use an application state if you wanted to start from the main window each
time. If you have a number of tests that require you to bring the application to
the same state, it saves testcase code to record the application state once and
pass its name to SetUpMachine. You will probably place your application
state declarations in your test frame file.
SetMultiAppStates ()
The SetMultiAppStates function must always be called, even if the testcase
specifies no application state, because SetMultiAppStates calls the
DefaultBaseState function in the absence of an appstate declaration.
SetMultiAppStates uses the information that SetUpMachine associated with
each connected machine to set potentially different application states or base
states for each machine.
spawn
SetMachine (sMach1)
// Here is placed code that drives test operations
The spawn statement starts an execution thread in which each statement in
the indented code block below it runs in parallel with all currently running
threads. There is no requirement that your testcase should drive all your test