background image
<< Client/Server - Recovering multiple tests | Client/Server - the spawn statement >>
Client/Server - the Edit.FindChange menu item
<< Client/Server - Recovering multiple tests | Client/Server - the spawn statement >>
User's Guide
349
19 I
NTRODUCTION
TO
C
LIENT
/S
ERVER
T
ESTING
Concurrent programming issues
When there are multiple machines being tested and more than one
application, the Agent on each machine must execute the correct operations
to establish the appropriate state, regardless of the current state of the
application. Chapter 22, "Multi-Application Testing" explains how to use the
4Test support functions with which a testcase accomplishes this and gives
code examples.
Concurrency
For SilkTest, concurrent processing means that Agents on a specified set of
machines drive the associated applications simultaneously. To accomplish
this, the host machine interleaves execution of the sets of code assigned to
each machine. This means that when you are executing identical tests on
several machines, each machine can be in the process of executing the same
operation (for example, select the Edit.FindChange menu item).
At the end of a set of concurrent operations, you will frequently want to
synchronize the machines so that you know that all are ready and waiting
before you submit the next operation. You can do this easily with 4Test.
There are several reasons for executing testcases concurrently:
·
You want to save testing time by running your functional tests for all the
different platforms at the same time and by logging the results centrally
(on the host machine).
·
You are testing cross-network operations.
·
You need to place a multi-user load on the server.
·
You are testing the application's handling of concurrent access to the
same database record on the server.
To accomplish the last example, testing concurrent database accesses, you
simply set all the machines to be ready to make the access and then you
synchronize. When all the machines are ready, you execute the operation that
commits the access operation--for example, clicking the OK button.
Consider the following example:
// [A] Execute 6 operations on all machines concurrently
for each sMachine in lsMachine
spawn
SixOpsFunction (sMachine)
rendezvous
// Synchronize
// [B] Do one operation on each machine
for each sMachine in lsMachine
spawn
[sMachine]MessageBox.OK.Click () // One operation
rendezvous
// Synchronize