background image
<< Multi-Application - a single-user notification test | Multi-Application - Notification example 2 explained >>
Multi-Application -Utility function
<< Multi-Application - a single-user notification test | Multi-Application - Notification example 2 explained >>
398
User's Guide
22 M
ULTI
-A
PPLICATION
T
ESTING
Code for notification example 2
2
Enter the string in argument one into the Recipient field and press the
Enter key twice to move to the Subject field.
3
Enter the string in argument two into the Subject field and press Enter to
move to the message body portion of the window (EditBody.Body).
4
Type the string in argument three into the Body field and type <Ctrl-s> to
send the message.
The next 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:
1
Verifies that the sent message was received (as indicated by the
NewMailAlert message box). The
NOTIFICATION_TIMEOUT
value
causes the Verify function to wait for that period of time for the window
to exist. If the timeout value is reached, the Verify raises an exception.
2
Verify that the dialog box CcMailNewMailAlert is active.
3
If the Verify executes without an exception, click on the OK button in the
CcMailNewMailAlert dialog box.
4
Pick the GoToInbox menu item from the Window menu.
5
Verify that a message exists in the Inbox by checking to see that the
Message menu has its DeleteMessage menu item enabled. If the menu
item is not enabled, there is no message in the Inbox and the Verify
function raises an exception.
Code for notification example 2
This is the complete testcase file for a two-user notification test. It shows the
next level of complexity in testing client/server notification operations. The
section after this test code explains the testing technique.
//------------------------------------------------------------
// This testcase logs in as user QAtest1 on the first machine,
// and logs in as user QAtest2 on the second machine; then
// sends a message from the user on the first machine to the
// user on the second machine; it then switches to the second