background image
<< Multi-Application - Code for notification example | Multi-Application - a single-user notification test >>
Multi-Application - Notification example 1 explained
<< Multi-Application - Code for notification example | Multi-Application - a single-user notification test >>
396
User's Guide
22 M
ULTI
-A
PPLICATION
T
ESTING
Notification example 1 explained
Notification example 1 explained
The first line in the testcase file is a comment that lists the name of the file
holding this code.
// csmail.t
The next line is an include statement. The explanations for each fragment of
code follow that code.
use "ccmail.inc"
The ccmail.inc file is defined for this testcase. It contains the window
declarations for the application plus application state definitions and
definitions for general purpose utility functions also needed by other
testcases designed for this application. You can find the ccmail.inc file in the
SilkTest Examples directory. Code fragments from that file are included as
needed in this discussion.
LogMeIn()
LogInUser(GetMachineData(NULL, "Username"),
GetMachineData(NULL, "Password") )
The utility function LogMeIn is called by the Invoke method for the CC Mail
main window, called CcMail. The LogInUser function is defined in
ccmail.inc. The machine data that LogInUser retrieves for its arguments gets
established by each test before the application state function for each
machine is invoked.
multitestcase SingleUserNotification (STRING sMachine1)
The function declaration for the testcase passes in the name of the SilkTest
Agent for the machine on which the application is running.
if(sMachine1 == NULL)
sMachine1 = "(local)"
This if statement allows you to invoke the testcase without specifying a
machine name when you want to run on the local machine.
SetUpMachine(sMachine1, CcMail, "EnsureInBoxIsEmpty")
The SetUpMachine function provides the name of the main application
window (CcMail) and the application state (EnsureInBoxIsEmpty) to be
established by SilkTest. EnsureInBoxIsEmpty is defined in ccmail.inc. This
statement is part of the standard setup code for multi-application tests. The
standard multi-application setup code is documented in "template.t
explained" on page 387 a
nd "Concurrency test explained" on page 391. The
setup code in this testcase is essentially the same.