You are on page 1of 6

'==============================================================================

===========================
' Name of the Script : Corporate Actions Home
' Scope of the Script : This test script covers 4 te
st cases related to the CA Home page
' Author
: Renuka
' Description : Corporate Actions Home
' Date and / or Version : 10-12-2008,version 1.0
'===============================================================================
============================
Sub CA_Home()
'****Declaration of Environmenta
l Variable
Environment.Value("Execution_Log
")="true"
'''''''''Test case count
Const TC_COUNT = 4
strVar = Environment("TestDir")
strIndVar = Split(strVar,"\",-1,
1)
strBound = UBound(strIndVar)
strAllPath =""
For intPathCounter = 0 to strBou
nd - 1
strAllPath = str
AllPath & strIndVar(intPathCounter) &"\"
Next
strPath = Trim(strPath)
strDataPath = strAllPath & "Data
Tables\"
strLibPath = strAllPath & "Funct
ion_Library\"

'****Adding CA Login sheet to th


e dataTable and Importing the Input DataTable**************
DataTable.AddSheet "CALogin"
DataTable.ImportSheet strDataPat
h & "Login.xls","CALogin","CALogin"
DataTable.AddSheet "CAHome"
DataTable.ImportSheet strDataPat
h & "CorporateActionsProfile.xls","CAHome","CAHome"
DataTable.AddSheet "HomePageVeri
fication"
DataTable.ImportSheet strDataPat
h & "CorporateActionsProfile.xls","HomePageVerification","HomePageVerification"
Environment.Value("strSheetName"
) = "CAHome"
' Logs the Scenario name Executi
on in a .csv file
Call Execution_log(DataTable.Val
ue("Scenario_Name", "Master"), "", "", "")
'**** Invoking IE and navigat
ing to the ADR Login page
DataTable.GetSheet("CALogin").Se
tCurrentRow(1)
Call invoke_URL("CorporateAction
s","Login Page",DataTable.Value("URL","CALogin"))
'****Checking the username, pass
word and login objects in the login page
Call pageCheck_WebEdit("Corporat
eActions","Login Page","username;j_password","")
Call pageCheck_WebButton("Corpor
ateActions","Login Page","Login","")
'****Entering username and passw
ord and login into the masterfile application
Call login("CorporateActions","L
ogin Page","User","CALogin")
Environment.Value("DATATABLE_ROW
")=1
DataTable.GetSheet("CAHome").Set
CurrentRow(Environment.Value("DATATABLE_ROW"))
'
''***************************************** TC D
river Start *******************************************************
'
For intTCCount = 1 to TC_COUNT

Environment.Value("Execution_Log") = "true"
If DataTable("TestRunFlag","CAHome")="Y" Then ''If run flag is Y in te
st data table
Reporter.ReportEvent micDone,"######## BEGIN TEST CASE - '" & DataTable("TestCas
eID","CAHome") & "' ########### ","Execution of Test Case '" & DataTable("TestCa
seDesc","CAHome") & "' Started"
strFuncName = "CAHome_TC" & intTCCount & "()" ''Formation of function
name
''Call Function
Execute "Call " & strFuncName

If Environment.Value("Execution_Log") = "true" Then


Call Execution_log("",Datatable.Value("TestCaseID", "CAHome"), Datatable.Value("
TestCaseDesc", "CAHome"), "PASS")
Else
Call Execution_log("",Datatable.Value("TestCaseID", "CAHome"), Datatable.Value("
TestCaseDesc", "CAHome"), "FAIL")
End If
Reporter.ReportEvent micDone,"######### END OF TEST CASE - '" & DataTable("TestC
aseID","CAHome") & "###########","The Test Case Execution Completed"
End If

'Checking AND incrementing the datatable

strPrevious=Trim(DataTable.Value("TestCaseID","CAHome"))

''Increment the test data table row

Environment.Value("DATATABLE_ROW") = Environment.Value("DATATABLE_ROW") + 1
DataTable.GetSheet("CAHome").SetCurrentRow(Environment.Value("DATATABLE_ROW"
))
strNext=Trim(DataTable.Value("TestCaseID","CAHome"))
While strPrevious = strNext
Environment.Value("DATATABLE_ROW") = Environment.Value("DATATABLE_ROW") + 1
DataTable.GetSheet("CAHome").SetCurrentRow(Environment.Value("DATATABLE_ROW"))
strNext=Trim(DataTable.Value("TestCaseID","CAHome"))
Wend
Next
Call logoutfromApp("CorporateAct
ions","Depositary Receipt Division's")
''***************************************** TC Driver End **********************
*********************************
End Sub
'**********************************************Test Case 1 *********************
*****************************
Public Function CAHome_TC1()
Environment.Value("TestCase_Log") = "true"
'#Step1
'Navigate to DR Home page after successful login
.
Call chkCAHomePage("CorporateActions","Deposita
ry Receipt Division's",DataTable.Value("HomePageLinks","HomePageVerification"),D
ataTable.Value("UserName","HomePageVerification"))
If Environment.Value("TestCase_
Log") = "true"Then
Reporte
r.ReportEvent micPass,"Step1: Check for DR Home Page","The Required Links and t
he User Details are displayed Successfully"
Else
Reporter
.ReportEvent micFail,"Step1: Check for DR Home Page","The Required Links and the
User Details are NOT displayed Successfully"
Environm
ent.Value("TestCase_Log") = "false"
End If
End Function

'**********************************************Test Case 2 *********************


*****************************
Public Function CAHome_TC3()
Environment.value("TestCase_log")="true"
' Step#1 --> login -- covered in TC 1
Reporter.ReportEvent micDone,"Step1: Navigate to
the DR home page after successful log in","This Step is performed in TC 1 itsel
f"
'' Step#2
'' Clicks on Corporate Actions in DR Home page and verifying the menu items ar
e displayed
Browser("CorporateActions").Page("Depositary Receipt
Division's").WebElement("CorporateActions").Click
Call chkCAPage("CorporateActions","Depositary Receipt
Division's",DataTable.Value("MenuName","HomePageVerification"))
If Environment.Value("TestCase_
Log") = "true"Then
Reporter
.ReportEvent micPass,"Step2: Check for the menu items in CA Home Page","The Requ
ired Menu items are displayed Successfully"
Else
Reporter
.ReportEvent micFail,"Step2: Check for the menu items in CA Home Page","The Requ
ired Menu items are NOT displayed "
Environm
ent.Value("TestCase_Log") = "false"
End If
' Step#3
' Move mouse over any menu and select item from Menu.Ex:- Profile -> Underlyin
g Event
Call select_Menu("CorporateActio
ns","CORPORATE ACTIONS",DataTable.Value("MenuPath1","CAHome"))
' Verifying the required menu items are present in the screen
Call chkCAPage("CorporateActions
","Depositary Receipt Division's",DataTable.Value("MenuName","HomePageVerificati
on"))
If Environment.Value("TestCase_
Log") = "true"Then
Reporter
.ReportEvent micPass,"Step3: Check for the menu items in the selected search scr
een","The Required Menu items are displayed Successfully"
Else
Reporter
.ReportEvent micFail,"Step3: Check for the menu items in the selected search scr
een","The Required Menu items are NOT displayed "
Environm
ent.Value("TestCase_Log") = "false"
End If
'step#4
' Select 'DR Home' under 'Home'.
Call select_Menu("CorporateActio
ns","CORPORATE ACTIONS",DataTable.Value("MenuPath2","CAHome"))
If Browser("CorporateActions").P
age("Depositary Receipt Division's").Exist(2) Then
Reporter.ReportEvent mic
Pass,"Step4:Check for the presense of the ADR home page","The ADR Home page appe
ars as required"
Else
Reporter.ReportEvent mic
Fail,"Step4: Check for the presense of the ADR home page","The ADR home page doe
s not appear as required"
Environment.Value("Execu
tion_Log")="false"
End If
End Function
'************************************************* Test Case 4 ***************
***
Public Function CAHome_TC4()
'step#1
' Navigate to DR Home page after successful login.
Call chkCAHomePage("CorporateActions","Depositar
y Receipt Division's",DataTable.Value("HomePageLinks","HomePageVerification"),Da
taTable.Value("UserName","HomePageVerification"))
If Environment.Value("T
estCase_Log") = "true"Then
Reporter.ReportEvent micPass,"Step1: Check for DR Home Page","The Required Link
s and the User Details are displayed Successfully"
Else
Repo
rter.ReportEvent micFail," Step1:Check for DR Home Page","The Required Links an
d the User Details are NOT displayed Successfully"
Environment.Value("TestCase_Log") = "false"
End If
' step#2
' Click on Corporate Actions in DR Home page.
Browser("CorporateActions").Page
("Depositary Receipt Division's").WebElement("CorporateActions").Click
If Browser("CorporateActions").P
age("CORPORATE ACTIONS").Exist(2) Then
Reporter.ReportEvent mi
cPass,"Step2: Check whether the Corporate actions page appears or not","The Corp
orate actions page appears as required"
Else
Reporter.ReportEvent mi
cFail,"Step2: Check whether the corporate actions page appears or not","The Corp
orate actions page does not appear as required"
Environment.Value("Execu
tion_Log")="false"
End If
' step#3
' Move mouse over any menu and select item from Menu. Ex:- Profile -> Underly
ing Notification Search
Call select_Menu("CorporateActions","CORPORATE A
CTIONS",DataTable.Value("MenuPath1","CAHome"))
Call chkCAPage("CorporateActions","Depositary Re
ceipt Division's",DataTable.Value("MenuName","HomePageVerification"))
If Environment.Value("T
estCase_Log") = "true"Then
Reporter.ReportEvent micPass,"Step3: Check for the menu items in the selected se
arch screen","The Required Menu items are displayed Successfully"
Else
Step3: Reporter.ReportEvent micFail,"Step3: Check for the menu items in the sele
cted search screen","The Required Menu items are NOT displayed "
Environment.Value("TestCase_Log") = "false"
End If
'step #4
' Click on 'Home' in any of the search screens.
Browser("CorporateActions").Page("CORPORATE ACTI
ONS").WebElement("HOME").Click
If Browser("CorporateActions").P
age("Depositary Receipt Division's").Exist(2) Then
Reporter.ReportEvent mic
Pass,"Step4:Check for the presense of the ADR home page","The ADR Home page appe
ars as required"
Else
Reporter.ReportEvent mic
Fail,"Step4: Check for the presense of the ADR home page","The ADR home page doe
s not appear as required"
Environment.Value("Execu
tion_Log")="false"
End If
End Function
'*******************************************************************************
********************************************************************************
*************************************

You might also like