This functionality is supported only if you are using the Classic Agent.
This topic contains the complete test case file for a single-user notification test. It shows a testing technique for a type of communication frequently used in client/server applications. Notification Test Example Code (2 of 2) shows a notification test between two users running their own copies of the client application. This illustrates doing the simplest case first and then adding the next level of complexity when you go from one user to two users. For additional information on the testing technique, see Notification Test Example Explained (1 of 2).
// ccmail.t use "ccmail.inc" LogMeIn() LogInUser(GetMachineData( NULL, "Username" ), GetMachineData( NULL, "Password" ) ) //------------------------------------------------------------ multitestcase SingleUserNotification ( STRING sMachine1 optional ) if( sMachine1 == NULL ) sMachine1 = "(local)" //=== MULTI-APPLICATION SETUP SECTION ===================// SetUpMachine( sMachine1, CcMail, "EnsureInBoxIsEmpty" ) SetMachineData( sMachine1, "Username", "QAtest1" ) SetMachineData( sMachine1, "Password", "QAtest1" ) SetMultiAppStates() //=== TEST BEGINS HERE ==================================// SetMachine( sMachine1 ) SimpleMessage( "QAtest1", "Message to myself", "A message to myself" ) Verify( CcMailNewMailAlert.Exists( NOTIFICATION_TIMEOUT ), TRUE ) Verify( CcMailNewMailAlert.IsActive(), TRUE, "ALERT" ) CcMailNewMailAlert.OK.Click() CcMail.xWindow.GoToInbox.Pick () Verify( CcMail.Message.DeleteMessage.IsEnabled(), TRUE, "MESSAGE WAITING" )
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:
The following block of code verifies the results of the test.
Verify(CcMailNewMailAlert.Exists(NOTIFICATION_TIMEOUT), TRUE ) Verify(CcMailNewMailAlert.IsActive(), TRUE, "ALERT") CcMailNewMailAlert.OK.Click() CcMail.xWindow.GoToInbox.Pick () Verify(CcMail.Message.DeleteMessage.IsEnabled(), TRUE, "MESSAGE WAITING")
The above code does the following: