Case Study for Squirrel mail
This document walks you through the creation of a WET test case, object depot Xml file and also simulating web page with simulatedUI and with simulated treeview. The web pages used here is from Squirrel Mail, which is a mail application.
The Case study for Squirrel Mail is applicable for any other webmail application such as Gmail,yahoomail.
At the end of this exercise, you should be able to
Identify objects,
Define tests
Perform actions on these objects
Use checkpoints to verify your results.
Creating scripts for Login of Squirrel Mail using SimulatedUI
application
1)Open a IE and navigate to 'webmail.example.org'
2)Open the Wet Manager and launch the Simulated IE application. Sync with the opened IE 'webmail.qantom.int' from the Simulated IE by clicking Browser->Launch Browser
Using Launch Browser Navigate to URL 'webmail.example.org'
IE is opened for the given url and then mirror reflection of the opened IE is shown in simulated IE after few seconds.
Fig: SimulatedIE
Launch Edit Configuration for configuration of the editor.It is either the Object Depot or the Full Definition View
3)If you want to navigate to a website which is already opened then use sync with open IE browser option.
A simulated browser is a windows application that looks similar to an IE browser, but the operations can not be performed directly as in IE . Instead a context sensitive pop up menu is provided using which the tester 'instructs' to do certain operations.
4)Using Wet Manager Launch a Object Depot and Script editor application.
Associate the script editor and object depot to simulated IE :
The scripts will be recorded to the script editor only if the editor is been associated with the simulated IE. To associate the editor open the editor present in wet manager and then go to Associate -> Editor. A function dialog box is opened , select the opened editor from the list and click on add .
To use the object depot while working with simulated IE associate the opened opened depot object using Associate -> Object.
5)Right click on the name textfield in the Simulated IE .A context menu is shown
Click on set. A function dialog is shown
Click on Add.The text 'webmailtester' is added to the textfield 'Name' both in Real
IE as well as SimulatedIE.
6)In the Simulated IE right click on the Password textfield and click on set.Enter the password in the Function Dialog Box.
7)Right click on the 'Login' Button.A context menu is shown and click on 'click'.
The Real IE will login into the account and same is reflected in Simulated IE
8)The corresponding script gets added in the associate editor and objects added to object depot.
Associate
Object Depot as Above
The Script Editor
9)Save the Script editor as Login.rb and Object Depot as Login.xml
Creating scripts for ComposeMail of Squirrel Mail using Wet TreeView
application
The WET Treeview is a windows application in which all the elements of the treeview are displayed in a hierarchical manner using a treeview. In this view, you can then perform various operations like setting text, clicking, etc., These operations are automatically converted to corresponding WET scripts and when applicable, the object depot is also updated.
10)Sync with the Inbox web page of SquirrelMail from the Simulated IE by clicking Browser->Sync with IE->Qantom Software-Login
Fig:The SimulatedIE Window
11)Using Associate Script record the scripts to to the script editor.
12)Right click on Link 'Check mail' and click on 'click'
The
corresponding operation is reflected in Real as well as SimulatedIE
Browser
13)Right Click on Link 'Compose' and click on 'click' in Context Menu.The Real IE Browser will navigate to ComposeMail web page of SquirrelMail.
14)Enter the To address,From address,Subject respectively in the 'To:' 'From:','Subject' Textfield using set function.Then right click on the button object The corresponding operations are reflected in real browser and Send Mail functionality of the Squirrel Mail is tested.
The script for the Compose Mail operation is recorded as below
Save the Script as Compose.rb
Note:The Object Depot is not associated with the Simulated IE.Hence the script above has the Full Definition View
Creating Scripts for Logout of Squirrel Mail using Simulated IE
15)From Wet Manager Launch simulated IE application.Sync to the user's Inbox web page.
16)Right Click on the Link Signout.A context menu appears .Click on 'click' function.
The Signout operation is done in both real and Simulated IE.The associate script records the scripts for the corresponding operation.
The script will be
Executing Tests using Test Definition Editor
17)Using Wet Manager Launch Test Definition Editor application
The test definition editor application is used to create test definition files that can be used in WET automation. The test definition Editor in version 1.0 does not try to do anything smart. It acts as a (almost) dumb editor. For example, when you set the object depot file or transaction path using the test definition editor, then it does not try to check if the file exists or not and in case the file doesn't exist, it doesn't try to create one for you, Instead, it simply creates a test definition file.
Fig:The Test Definition Editor Window
Till now we performed three operations on Squirrel Mail
-Login to Squirrel Mail
-Composing a Mail
-Logout from Squirrel Mail
Login to Squirrel Mail is a Precondition for the Composing a Mail transcation and Logout is a teardown.
Creating Testdefs for Login Precondition
18)Open a New Test Defintion Editor Window .Change the name 'Please_specify_name_here' to 'Login'.In the Description Field enter the description as 'Login to Squirrel Mail is a Precondition for Compose Mail functionality Testing'
Set the path of Repository for the Login.xml path
19)Change the transaction name to 'LogintoSquirrelMail'.Add an appropriate description for the transaction and Choose the Script.path to load the appropriate script.(Here it is Login.rb)
The corresponding scripts gets loaded in the script window
20)Create a new folder SquirrelMail.Within this folder create another folder Login and Save this testdefs as test.defs
Logout from the Squirrel Mail is the teardown for the Compose Mail transaction
Creating Testdefs for Logout Teardown
21)Open a New Test Defintion Editor Window.Change the name 'Please_specify_name_here' to 'Logout'.In the Description Field enter the description as 'Logout from Squirrel Mail is a Teardown for Compose Mail functionality Testing'
22)19)Change
the transaction name to 'LogoutfromSquirrelMail'.Add an appropriate
description for the transaction and Choose the Script.path to load
the appropriate script.(Here it is Logout.rb)
23)In the SquirrelMail folder create another folder Logout and Save the testdefs as test.defs
Creating Testdefs for executing scripts to check the Compose Mail functionality with Precondition and Teardown
24)Open a New Test Defintion Editor Window .Change the name 'Please_specify_name_here' to 'Compose Mail'.In the Description Field enter the description as 'Checking the Compose Mail functionality for Squirrel Mail'.Add a Precondition and name it as 'LogintoSquirrelMail' and lll'y a Teardown and name it as 'LogoutfromSquirrelMail'.Change the name of transaction as 'Compose Mail'.Add the descriptions to Precondition,Transcation and Teardown to meaningful description
25)In
the Precondition choose the path of test.defs for precondition and
in Teardown choose the path of test.defs for Teardown.For
transaction script.path choose the path of Compose.rb
26)Within the SquirrelMail folder create Folder with name ComposeMail and Save the test.defs file
Execute the Scripts
26)Click on Tools->Execute .The scripts get executed and the results can be viewed in a default browser as shown below