background image
<< Multi-Application - Notification example 1 explained | Multi-Application -Utility function >>
Multi-Application - a single-user notification test
<< Multi-Application - Notification example 1 explained | Multi-Application -Utility function >>
User's Guide
397
22 M
ULTI
-A
PPLICATION
T
ESTING
Notification example 1 explained
This is a single-user testcase and therefore does not actually need the setup
methodology required by a multi-application test. However, this chapter
describes client/server testing, which is frequently multi-application testing,
and therefore all the example testcases use the multi-application coding
methods. We recommend that you also follow this practice, since consistency
of testing styles reduces coding errors in your testcases.
One difference for this testcase is that this is an application that requires the
user to log in. Therefore the following code fragment provides the user name
and password for the application under test:
SetMachineData (sMachine1, "Username", "QAtest1")
SetMachineData (sMachine1, "Password", "QAtest1")
These statements associate two pieces of information, named "Username"
and "Password," with the specified machine. In both cases the value of the
associated information is the same, "QAtest1." Now that this information is
available to the application state function, that function can log the user in.
This will happen as a result of the next statement.
SetMultiAppStates()
In this test, SetMultiAppStates will actually only set the application state for
the one machine.
SimpleMessage ("QAtest1", "Message to myself",
"A message to myself")
The above line invokes the following utility function from ccmail.inc, which
sends the short message to the local machine:
Utility function
void SimpleMessage (STRING sRecipient, STRING sSubject,
STRING sBody)
CcMail.Message.NewMessage.Pick()
NewMessage.MailingLabel.Recipient.SetText (sRecipient)
NewMessage.MailingLabel.Recipient.TypeKeys ("<Enter>")
NewMessage.MailingLabel.Recipient.TypeKeys ("<Enter>")
NewMessage.MailingLabel.SubjectField.SetText (sSubject)
NewMessage.MailingLabel.SubjectField.TypeKeys ("<Enter>")
NewMessage.EditBody.Body.TypeKeys (sBody)
NewMessage.EditBody.Body.TypeKeys ("<Ctrl-s>")
This function uses standard methods on Ccmail window components (defined
in ccmail.inc) to do the following:
1
Pick the NewMessage item from the Message menu.