You are on page 1of 17

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

==========================
' Name of the Script : MFAdminContactCategory
' Scope of the Script : This test script covers 6
test cases related to MF Administration Contact Category
' Author : Satish Dupati
' Description : MF Administration Contact
Category
' Date and / or Version : 03-12-2008,version 1.0
'===============================================================================
============================
Sub MFAdminContactCategory()
'****Declaration of Environmental Variable
Environment.Value("Execution_Log")="True"
Environment.Value("strSheetName")="ContactCategory"
'''''''''Test case count
Const TC_COUNT =6
strVar = Environment("TestDir")
strIndVar = Split(strVar,"\",-1,1)
strBound = UBound(strIndVar)
strAllPath =""
For intCounter = 0 to strBound - 1
strAllPath = strAllPath & strIndVar(intCounter)
&"\"
Next
strPath = Trim(strPath)
strDataPath = strAllPath & "DataTables\"
strLibPath = strAllPath & "Function_Library\"
' Including the Library files where all the Scripts are saved
'ExecuteFile strLibPath & "CAReportsAgingItemsTC.vbs"
'****Adding CALogin sheet to the dataTable and Importing the In
put DataTable
DataTable.AddSheet "MFLogin"
DataTable.ImportSheet strDataPath & "Login.xls","MFLogin","MFLog
in"
DataTable.AddSheet "ContactCategory"
DataTable.ImportSheet strDataPath & "MasterFileAdmin.xls","Conta
ctCategory","ContactCategory"
DataTable.AddSheet "HomePageVerification"
DataTable.ImportSheet strDataPath & "MasterFileReports.xls","Hom
ePageVerification","HomePageVerification"
DataTable.AddSheet "ReportHeader"
DataTable.ImportSheet strDataPath & "MasterFileReports.xls","Rep
ortHeader","ReportHeader"
'Logs the Scenario name Execution in a .csv file
Call Execution_log(DataTable.Value("Scenario_Name", "Master"), "
", "", "")
'****Invoking IE and navigating to the ADR Login page
DataTable.GetSheet("MFLogin").SetCurrentRow(1)
Call invoke_URL("MasterFile","Login Page",DataTable.Value("URL",
"MFLogin"))
'****Checking the username, password and login objects in the lo
gin page
Call pageCheck_WebEdit("MasterFile","Login Page","username;j_passwor
d","")
Call pageCheck_WebButton("MasterFile","Login Page","Login","")
'****Entering username and password and login into the masterfil
e application
Call login("MasterFile","Login Page","User","MFLogin")
Call chkADRHomePage("MasterFile","Depositary Receipt Division's"
,DataTable.Value("HomePageLinks","HomePageVerification"),Environment.Value("Norm
alUser"))
Environment.Value("DATATABLE_ROW")=1
DataTable.GetSheet("ContactCategory").SetCurrentRow(Environment.
Value("DATATABLE_ROW"))
'***************************************** TC Driver Strat *****
**************************************************
For intTCCount = 1 to TC_COUNT
Environment.Value("Execution_Log") = "True"
If DataTable("TestRunFlag","ContactCategory") = "Y" Then
''If run flag is Y in test data table
Environment.Value("TestCase_Log")="True"
Reporter.ReportEvent micDone,"######## BEGIN TEST CASE - '" & Da
taTable("TestCaseID","ContactCategory") & "' ########### ","Execution of Test Ca
se '" & DataTable("TestCaseDesc","ContactCategory") & "' Started"
strFuncName = "MFAdminContactCategory_TC" & intTCCount & "()"
''Formation of function name
Execute "Call " & strFuncName
If Environment.Value("Execution_Log") = "True"
Then
Call Execution_log("",Datatable.
Value("TestCaseID", "ContactCategory"), Datatable.Value("TestCaseDesc", "Contact
Category"), "PASS")
Else
Call Execution_log("",Datatable.
Value("TestCaseID", "ContactCategory"), Datatable.Value("TestCaseDesc", "Contact
Category"), "FAIL")
End If
Reporter.ReportEvent micDone,"######### END OF T
EST CASE - '" & DataTable("TestCaseID","ContactCategory") & "###########","The T
est Case Execution Completed"
End If
strPrevious=Trim(DataTable.Value("TestCaseID","ContactCa
tegory"))
''Increment the test data table row
Environment.Value("DATATABLE_ROW") = Environment.Value("
DATATABLE_ROW") + 1
DataTable.GetSheet("ContactCategory").SetCurrentRow(Envi
ronment.Value("DATATABLE_ROW"))
strNext=Trim(DataTable.Value("TestCaseID","ContactCatego
ry"))
While strPrevious = strNext
Environment.Value("DATATABLE_ROW") = Environment.Value
("DATATABLE_ROW") + 1
DataTable.GetSheet("ContactCategory").SetCurrentRow(En
vironment.Value("DATATABLE_ROW"))
strNext=Trim(DataTable.Value("TestCaseID","ContactCate
gory"))
Wend
Next
Call logoutfromApp("MasterFile","Depositary Receipt Division's")
End Sub
'***************************************** TC Driver End ***********************
********************************

'*******************************************************************************
************Test Case 1 to Test Case 6 *****************************************
********************************************************************************
******************
Public Function MFAdminContactCategory_TC1()
'Step 3
Call click_WebElement("MasterFile","Depositary Receipt Division'
s","MasterFile")
Call chkMFCAHomePage("MasterFile","MasterFile",DataTable.Value("
MenuName","HomePageVerification"),Environment.Value("NormalUser"))
If Environment.Value("TestCase_Log") = "True" Then
Reporter.ReportEvent micPass,"Step 3:Click on Ma
ster File","Master File screen is displayed with Welcome Message, Version and th
e Built Date. "
Else
Reporter.ReportEvent micFail,"Step 3:Click on M
aster File","Master File screen is displayed with Welcome Message, Version and t
he Built Date. "
Call captureScreenshot()
Environment.Value("TestCase_Log")="True"
End If
'Step 4,5
Call check_Menu("MasterFile","MasterFile",DataTable.Value("MenuP
ath","ContactCategory"))
Call select_Menu("MasterFile","MasterFile",DataTable.Value("Menu
Path","ContactCategory"))
Call pageCheck_WebElementinTable("MasterFile","Administration -
Contact","Search By:","ContactCategory:")
Call pageCheck_WebEditOR("MasterFile","Administration - Contact","Contac
tCategoryCode;ContactCategory")
Call pageCheck_WebElementinTable("MasterFile","Administration -
Contact","Contact Category Search Results;Contact Category;Contact Category Code
","ContactCategorySearchResults")
Call pageCheck_Image("MasterFile","Administration - Contact","Ne
w;Search;Clear","")
If Environment.Value("TestCase_Log") = "True" Then
Reporter.ReportEvent micPass,"Step 4,5:Click on
Administration Link and then Contact Category Link","The Administration Link li
st contained Contact Category, Administration - Contact Category Search screen d
isplayed with all required fields"
Else
Reporter.ReportEvent micFail,"Step 4,5:Click on
Administration Link and then Contact Category Link","The Administration Link l
ist contained Contact Category, Administration - Contact Category Search screen
displayed with all required fields"
Call captureScreenshot()
Environment.Value("TestCase_Log")="True"
End If
'Step 6
Call MFAdminContactSearch("MasterFile","Administration - Contact
")
Call chkMFAdminContactSearchResult("MasterFile","Administration
- Contact")
If Environment.Value("TestCase_Log") = "True" Then
Reporter.ReportEvent micPass,"Step 6:Entering an
y input value Click Search","Contact Category Search Results table present with
the fields with all Rows related to search value "
Else
Reporter.ReportEvent micFail,"Step 6:Entering a
ny input value Click Search","Contact Category Search Results table present with
the fields with all Rows related to search value "
Call captureScreenshot()
Environment.Value("TestCase_Log")="True"
End If
Call select_Menu("MasterFile","Administration - Contact","Home;D
R Home")
End Function
'*******************************************************************************
********************************************************************************
********************************************************************************
*************************************************
Public Function MFAdminContactCategory_TC2()
'Step 3
Call click_WebElement("MasterFile","Depositary Receipt Division'
s","MasterFile")
Call chkMFCAHomePage("MasterFile","MasterFile",DataTable.Value("
MenuName","HomePageVerification"),Environment.Value("NormalUser"))
If Environment.Value("TestCase_Log") = "True" Then
Reporter.ReportEvent micPass,"Step 3:Click on Ma
ster File","Master File screen is displayed with Welcome Message, Version and th
e Built Date. "
Else
Reporter.ReportEvent micFail,"Step 3:Click on M
aster File","Master File screen is displayed with Welcome Message, Version and t
he Built Date. "
Call captureScreenshot()
Environment.Value("TestCase_Log")="True"
End If
'Step 4,5
Call check_Menu("MasterFile","MasterFile",DataTable.Value("MenuP
ath","ContactCategory"))
Call select_Menu("MasterFile","MasterFile",DataTable.Value("Menu
Path","ContactCategory"))
Call pageCheck_WebElementinTable("MasterFile","Administration -
Contact","Search By:","ContactCategory:")
Call pageCheck_WebEditOR("MasterFile","Administration - Contact"
,"ContactCategoryCode;ContactCategory")
Call pageCheck_WebElementinTable("MasterFile","Administration -
Contact","Contact Category Search Results;Contact Category;Contact Category Code
","ContactCategorySearchResults")
Call pageCheck_Image("MasterFile","Administration - Contact","Ne
w;Search;Clear","")
If Environment.Value("TestCase_Log") = "True" Then
Reporter.ReportEvent micPass,"Step 4,5:Click on
Administration Link and then Contact Category Link","The Administration Link li
st contained Contact Category, Administration - Contact Category Search screen d
isplayed with all required fields"
Else
Reporter.ReportEvent micFail,"Step 4,5:Click on
Master File","Master File screen is displayed with Welcome Message, Version and
the Built Date. "
Call captureScreenshot()
Environment.Value("TestCase_Log")="True"
End If
'Step 6
Call MFAdminContactSearch("MasterFile","Administration - Contact
")
Call chkMFAdminContactSearchResult("MasterFile","Administration
- Contact")
If Environment.Value("TestCase_Log") = "True" Then
Reporter.ReportEvent micPass,"Step 6:Entering an
y input value Click Search","Contact Category Search Results table present with
the fields with all Rows related to search value "
Else
Reporter.ReportEvent micFail,"Step 6:Entering a
ny input value Click Search","Contact Category Search Results table present with
the fields with all Rows related to search value "
Call captureScreenshot()
Environment.Value("TestCase_Log")="True"
End If
'Step 7
If Browser("MasterFile").Page("Administration - Contact").WebTab
le("ContactCategoryResults").RowCount Then
strVal=Browser("MasterFile").Page("Administratio
n - Contact").WebTable("ContactCategoryResults").GetCellData(1,1)
Browser("MasterFile").Page("Administration - Con
tact").webElement("html tag:=TD","index:=0","innertext:="&strVal).click
Call PageCheck_MFAdminContactCategoryDetail("Mas
terFile","Contact Category Detail")
If Environment.Value("TestCase_Log") = "True"
Then
Reporter.ReportEvent micPass,"St
ep 7:Click any of the search result","Contact Category Opened with all req fiel
ds"
Else
Reporter.ReportEvent micFail,"S
tep 7:Click any of the search result","Contact Category Opened with all req fie
lds"
Call captureScreenshot()
Environment.Value("TestCase_Log
")="True"
End If
'Step 8
intSubDeptRC=(Browser("MasterFile").Page("Contac
t Category Detail").WebTable("SubdepartmentContact").RowCount)-2
Call set_WebEdit_Value("MasterFile","Contact Cat
egory Detail","ContactCategory",DataTable.Value("NewContactCategory","ContactCat
egory"))
Call select_Combo_Value("MasterFile","Contact Ca
tegory Detail","BNYCategoryFlag","No")
Call click_Image("MasterFile","Contact Category
Detail","SaveProfile")
Wait(5)
Call fnc_wait(Browser("MasterFile").Page("Contac
t Category Detail").WebTable("Validation Error"))
If intSubDeptRC Then
If (Browser("MasterFile").Page("Contact Category Detail"
).WebTable("Validation Error").RowCount)-4 = Browser("MasterFile").Page("Contact
Category Detail").WebTable("SubdepartmentContact").RowCount Then
Reporter.ReportE
vent micPass,"Step 8:Change the Contact Category,BNY Category Flag fields and c
lick save","Validation Error window is present with same number of rows that Sub
Department Contact consists"
Else
Reporter.ReportE
vent micFail,"Step 8:Change the Contact Category,BNY Category Flag fields and c
lick save","Validation Error window is present with same number of rows that Sub
Department Contact consists"
Call captureScre
enshot()
Environment.Valu
e("TestCase_Log")="True"
Environment.Valu
e("Execution_Log")="False"
End If
Call click_Image("MasterFile","C
ontact Category Detail","ValidationErrorClose")
Else
Reporter.ReportEvent micWarning,
"Step 8:Verification of Validation Error window,Sub Department Contact Category
Detail Records","No records in the table so there is No validation Error"
End If
'Step 9
Call select_Combo_Value("MasterFile","Contact Category Detail","
BNYCategoryFlag","Yes")
Call click_Image("MasterFile","Contact Category
Detail","SaveProfile")
Call pageCheck_ImageORNegitive("MasterFile","Con
tact Category Detail","ValidationErrorImage")
If Environment.Value("TestCase_Log") = "True" T
hen
Reporter.ReportEvent micPass,"St
ep 9:Change the BNY Category Flag to Yes and Click Save","Contact Category which
we changed will be saved."
Else
Reporter.ReportEvent micFail,"S
tep 9:Change the BNY Category Flag to Yes and Click Save","Contact Category whic
h we changed will be saved."
Call captureScreenshot()
Environment.Value("TestCase_Log
")="True"
End If
Call select_Menu("MasterFile","Contact Category
Detail","Home;DR Home")
End If
End Function
'*******************************************************************************
********************************************************************************
********************************************************************************
*************************************************
Public Function MFAdminContactCategory_TC3()
'Step 3
Call click_WebElement("MasterFile","Depositary Receipt Division'
s","MasterFile")
Call chkMFCAHomePage("MasterFile","MasterFile",DataTable.Value("
MenuName","HomePageVerification"),Environment.Value("NormalUser"))
If Environment.Value("TestCase_Log") = "True" Then
Reporter.ReportEvent micPass,"Step 3:Click on Ma
ster File","Master File screen is displayed with Welcome Message, Version and th
e Built Date. "
Else
Reporter.ReportEvent micFail,"Step 3:Click on M
aster File","Master File screen is displayed with Welcome Message, Version and t
he Built Date. "
Call captureScreenshot()
Environment.Value("TestCase_Log")="True"
End If
'Step 4,5
Call check_Menu("MasterFile","MasterFile",DataTable.Value("MenuP
ath","ContactCategory"))
Call select_Menu("MasterFile","MasterFile",DataTable.Value("Menu
Path","ContactCategory"))
Call pageCheck_WebElementinTable("MasterFile","Administration -
Contact","Search By:","ContactCategory:")
Call pageCheck_WebEditOR("MasterFile","Administration - Contact"
,"ContactCategoryCode;ContactCategory")
Call pageCheck_WebElementinTable("MasterFile","Administration -
Contact","Contact Category Search Results;Contact Category;Contact Category Code
","ContactCategorySearchResults")
Call pageCheck_Image("MasterFile","Administration - Contact","Ne
w;Search;Clear","")
If Environment.Value("TestCase_Log") = "True" Then
Reporter.ReportEvent micPass,"Step 4,5:Click on
Administration Link and then Contact Category Link","The Administration Link li
st contained Contact Category, Administration - Contact Category Search screen d
isplayed with all required fields"
Else
Reporter.ReportEvent micFail,"Step 4,5:Click on
Administration Link and then Contact Category Link","The Administration Link l
ist contained Contact Category, Administration - Contact Category Search screen
displayed with all required fields"
Call captureScreenshot()
Environment.Value("TestCase_Log")="True"
End If
'Step 6
Call MFAdminContactSearch("MasterFile","Administration - Contact
")
Call chkMFAdminContactSearchResult("MasterFile","Administration
- Contact")
If Environment.Value("TestCase_Log") = "True" Then
Reporter.ReportEvent micPass,"Step 6:Entering an
y input value Click Search","Contact Category Search Results table present with
the fields with all Rows related to search value "
Else
Reporter.ReportEvent micFail,"Step 6:Entering a
ny input value Click Search","Contact Category Search Results table present with
the fields with all Rows related to search value "
Call captureScreenshot()
Environment.Value("TestCase_Log")="True"
End If
'Step 7
If Browser("MasterFile").Page("Administration - Contact").WebTab
le("ContactCategoryResults").RowCount Then
strVal=Browser("MasterFile").Page("Administratio
n - Contact").WebTable("ContactCategoryResults").GetCellData(1,1)
Browser("MasterFile").Page("Administration - Con
tact").webElement("html tag:=TD","index:=0","innertext:="&strVal).click
Call PageCheck_MFAdminContactCategoryDetail("Mas
terFile","Contact Category Detail")
If Environment.Value("TestCase_Log") = "True" T
hen
Reporter.ReportEvent micPass,"St
ep 7:Click any of the search result","Contact Category Opened with all req fiel
ds"
Else
Reporter.ReportEvent micFail,"S
tep 7:Click any of the search result","Contact Category Opened with all req fie
lds"
Call captureScreenshot()
Environment.Value("TestCase_Log
")="True"
End If
strRowCountBefore=Browser("MasterFile").Page("Co
ntact Category Detail").WebTable("SubdepartmentContact").RowCount
'Step 8
Call click_webButton("MasterFile","Contact Categ
ory Detail","Add")
strRowCountAfter=Browser("MasterFile").Page("Co
ntact Category Detail").WebTable("SubdepartmentContact").RowCount
If strRowCountBefore < strRowCountAfter Then
Reporter.ReportEvent micPass,"St
ep 8:Verification of new row addition in Sub Dept Cotact Records","New row is ad
ded "
Else
Reporter.ReportEvent micFail,"S
tep 8:Verification of new row addition in Sub Dept Cotact Records","New row is N
OT added "
Call captureScreenshot()
Environment.Value("Execution_Log
")="False"
End If
'Step 9
Browser("MasterFile").Page("Contact Category Det
ail").WebTable("SubdepartmentContact").ChildItem(strRowCountAfter,1,"WebList",0)
.Select DataTable.Value("NewDepartment","ContactCategory")
Browser("MasterFile").Page("Contact Category Det
ail").WebTable("SubdepartmentContact").ChildItem(strRowCountAfter,2,"Image",0).c
lick
If Browser("MasterFile").Page("Contact Category
Detail").Frame("SubDepartmentFrame").WebTable("Subdepartment").RowCount > 1 Then
strSubDeptval=Browser("MasterFil
e").Page("Contact Category Detail").Frame("SubDepartmentFrame").WebTable("Subdep
artment").GetCellData(2,1)
Browser("MasterFile").Page("Cont
act Category Detail").Frame("SubDepartmentFrame").webElement("html tag:=TD","inn
ertext:="&strSubDeptval).click
If Browser("MasterFile").Page("C
ontact Category Detail").WebTable("SubdepartmentContact").ChildItem(strRowCountA
fter,3,"WebEdit",0).getRoProperty("value")<>"" And Browser("MasterFile").Page("C
ontact Category Detail").WebTable("SubdepartmentContact").ChildItem(strRowCountA
fter,4,"WebEdit",0).getRoProperty("value")<>"" Then
Reporter.ReportE
vent micPass,"Step 9:Verification for auto updation of Position And Location Val
ues","Position and Location values are Auto Updated"
Else
Reporter.Report
Event micFail,"Step 9:Verification for auto updation of Position And Location Va
lues","Position and Location values are Not Auto Updated"
Call captureScr
eenshot()
Environment.Val
ue("Execution_Log")="False"
End If
'Step 10
Call click_Image("MasterFile","C
ontact Category Detail","SaveProfile")
If Browser("MasterFile").Page("C
ontact Category Detail").WebTable("Validation Error").Exist Then
Call click_Image
("MasterFile","Contact Category Detail","ValidationErrorClose")
Call pageCheck_I
mageORNegitive("MasterFile","Contact Category Detail","ValidationErrorImage")
End If
If Environment.Value("TestCase_
Log") = "True" Then
Reporter.ReportE
vent micPass,"Step 10:Click Save","The row should be saved and it should be sort
ed with first alphabet."
Else
Reporter.Report
Event micFail,"Step 10:Click Save","The row should be saved and it should be sor
ted with first alphabet."
Call captureScr
eenshot()
Environment.Val
ue("TestCase_Log")="True"
End If
'Step 11
Browser("MasterFile").Page("Cont
act Category Detail").WebTable("SubdepartmentContact").ChildItem(strRowCountAfte
r,6,"Image",0).click
If Browser("MasterFile").Dialog(
"Microsoft Internet Explorer").Exist Then
Reporter.ReportE
vent micPass,"Step 11:Verification for A Microsoft Pop-up stating 'Are u sure wa
nt to delete this record'","Microsoft popup is appeared"
'Step 12
Browser("MasterF
ile").Dialog("Microsoft Internet Explorer").WinButton("OK").Click
If Browser("Mast
erFile").Page("Contact Category Detail").WebTable("SubdepartmentContact").RowCou
nt < strRowCountAfter Then
Reporter.ReportEvent micPass,"Step 12:Verification for Deletion of Added New Row
","New Row is Deleted"
Else
Reporter.ReportEvent micFail,"Step 12:Verification for A Microsoft Pop-up statin
g 'Are u sure want to delete this record'","Popup not appeared"
Call captureScreenshot()
Environment.Value("Execution_Log")="False"
End If
Else
Reporter.ReportE
vent micFail,"Step 11:Verification for A Microsoft Pop-up stating 'Are u sure wa
nt to delete this record'","Popup not appeared"
Call captureScre
enshot()
Environment.Valu
e("Execution_Log")="False"
End If
End If
Call select_Menu("MasterFile","Contact Category
Detail",DataTable.Value("MenuPath","ContactCategory"))
End If
Call select_Menu("MasterFile","Administration - Contact","Home;D
R Home")
End Function
'*******************************************************************************
********************************************************************************
********************************************************************************
*************************************************
Public Function MFAdminContactCategory_TC4()
'Step 3
Call click_WebElement("MasterFile","Depositary Receipt Division'
s","MasterFile")
Call chkMFCAHomePage("MasterFile","MasterFile",DataTable.Value("
MenuName","HomePageVerification"),Environment.Value("NormalUser"))
If Environment.Value("TestCase_Log") = "True" Then
Reporter.ReportEvent micPass,"Step 3:Click on Ma
ster File","Master File screen is displayed with Welcome Message, Version and th
e Built Date. "
Else
Reporter.ReportEvent micFail,"Step 3:Click on M
aster File","Master File screen is displayed with Welcome Message, Version and t
he Built Date. "
Call captureScreenshot()
Environment.Value("TestCase_Log")="True"
End If
'Step 4,5
Call check_Menu("MasterFile","MasterFile",DataTable.Value("MenuP
ath","ContactCategory"))
Call select_Menu("MasterFile","MasterFile",DataTable.Value("Menu
Path","ContactCategory"))
Call pageCheck_WebElementinTable("MasterFile","Administration -
Contact","Search By:","ContactCategory:")
Call pageCheck_WebEditOR("MasterFile","Administration - Contact"
,"ContactCategoryCode;ContactCategory")
Call pageCheck_WebElementinTable("MasterFile","Administration -
Contact","Contact Category Search Results;Contact Category;Contact Category Code
","ContactCategorySearchResults")
Call pageCheck_Image("MasterFile","Administration - Contact","Ne
w;Search;Clear","")
If Environment.Value("TestCase_Log") = "True" Then
Reporter.ReportEvent micPass,"Step 4,5:Click on
Administration Link and then Contact Category Link","The Administration Link li
st contained Contact Category, Administration - Contact Category Search screen d
isplayed with all required fields"
Else
Reporter.ReportEvent micFail,"Step 4,5:Click on
Administration Link and then Contact Category Link","The Administration Link l
ist contained Contact Category, Administration - Contact Category Search screen
displayed with all required fields"
Call captureScreenshot()
Environment.Value("TestCase_Log")="True"
End If
'Step 6
Call click_Image("MasterFile","Administration - Contact","New")
Call pageCheck_WebElementinTable("MasterFile","Contact Category
Detail","New Contact Category","NewContactCategory")
Call pageCheck_WebElementinTable("MasterFile","Contact Category
Detail","Contact Category Detail","ContactCategoryDetail")
Call pageCheck_webEditOR("MasterFile","Contact Category Detail",
"ContactCategory;ContactCategoryCode")
Call pageCheck_webListOR("MasterFile","Contact Category Detail",
"BNYCategoryFlag")
Call pageCheck_WebElementinTable("MasterFile","Contact Category
Detail","Subdepartment Contact Category Detail;Department;Subdepartment;Position
;Location","SubdepartmentContact")
Call pageCheck_webButton("MasterFile","Contact Category Detail",
"Add","")
If Environment.Value("TestCase_Log") = "True" Then
Reporter.ReportEvent micPass,"Step 6:Click New",
"Contact Category Detail screen displayed "
Else
Reporter.ReportEvent micFail,"Step 6:Click New"
,"Contact Category Detail screen displayed "
Call captureScreenshot()
Environment.Value("TestCase_Log")="True"
End If
'Step 7
Call click_Image("MasterFile","Contact Category Detail","SavePro
file")
Call ValidationErrorDetails_AllDetails("MasterFile","Contact Cat
egory Detail","Validation Error","Contact Category Code;Contact Category;BNY Cat
egory Flag","Field is required.","SubdeptContactCat")
If Environment.Value("TestCase_Log") = "True" Then
Reporter.ReportEvent micPass,"Step 7:Without ent
ering any values click Save","Validation Error window displayed with all the fi
elds "
Else
Reporter.ReportEvent micFail,"Step 7:Without en
tering any values click Save","Validation Error window displayed with all the f
ields "
Call captureScreenshot()
Environment.Value("TestCase_Log")="True"
End If
'Step 8
Call click_Image("MasterFile","Contact Category Detail","Validat
ionErrorClose")
If Environment.Value("TestCase_Log") = "True" Then
Reporter.ReportEvent micPass,"Step 8:Close the W
indow ","Window should be closed"
Else
Reporter.ReportEvent micFail,"Step 8:Close the
Window ","Window should be closed"
Call captureScreenshot()
Environment.Value("TestCase_Log")="True"
End If
'Step 9
Call set_webEdit_Value("MasterFile","Contact Category Detail","C
ontactCategory",Datatable.Value("NewContactCategory","ContactCategory"))
strOldGenNum= Datatable.Value("NewContactCategoryCode","ContactC
ategory")
strNewGenNum = "ACD"&Chr(Asc(Mid(strOldGenNum,4))+1)
Datatable.Value("NewContactCategoryCode","ContactCategory") = st
rNewGenNum
strVar = Environment("TestDir")
strIndVar = Split(strVar,"\",-1,1)
strBound = UBound(strIndVar)
strAllPaths = ""
For intCounter = 0 to strBound - 1
strAllPaths = strAllPaths & strIndVar(intCounter
) &"\"
Next
strAllPaths = Trim(strAllPaths)
strDataPath1 = strAllPaths & "DataTables\"
DataTable.ExportSheet strDataPath1 & "MasterFileAdmin.xls","ContactCateg
ory"
Call set_webEdit_Value("MasterFile","Contact Category Detail","C
ontactCategoryCode",Datatable.Value("NewContactCategoryCode","ContactCategory"))
Call select_Combo_Value("MasterFile","Contact Category Detail","
BNYCategoryFlag",Datatable.Value("BNYCategoryFlag","ContactCategory"))
Call click_Image("MasterFile","Contact Category Detail","SavePro
file")
Call pageCheck_ImageORNegitive("MasterFile","Contact Category De
tail","ValidationErrorImage")
If Environment.Value("TestCase_Log") = "True" Then
Reporter.ReportEvent micPass,"Step 9: Fill the i
nformation for Contact Category, Contact Category Code, BNY Category Flag","Deta
ils should be saved."
Else
Reporter.ReportEvent micFail,"Step 9: Fill the
information for Contact Category, Contact Category Code, BNY Category Flag","Det
ails should be saved."
Call captureScreenshot()
Environment.Value("TestCase_Log")="True"
End If
Call select_Menu("MasterFile","Contact Category Detail","Home;DR
Home")
End Function
'*******************************************************************************
********************************************************************************
********************************************************************************
*************************************************
Public Function MFAdminContactCategory_TC5()
'Step 3
Call click_WebElement("MasterFile","Depositary Receipt Division'
s","MasterFile")
Call chkMFCAHomePage("MasterFile","MasterFile",DataTable.Value("
MenuName","HomePageVerification"),Environment.Value("NormalUser"))
If Environment.Value("TestCase_Log") = "True" Then
Reporter.ReportEvent micPass,"Step 3:Click on Ma
ster File","Master File screen is displayed with Welcome Message, Version and th
e Built Date. "
Else
Reporter.ReportEvent micFail,"Step 3:Click on M
aster File","Master File screen is displayed with Welcome Message, Version and t
he Built Date. "
Call captureScreenshot()
Environment.Value("TestCase_Log")="True"
End If
'Step 4,5
Call check_Menu("MasterFile","MasterFile",DataTable.Value("MenuP
ath","ContactCategory"))
Call select_Menu("MasterFile","MasterFile",DataTable.Value("Menu
Path","ContactCategory"))
Call pageCheck_WebElementinTable("MasterFile","Administration -
Contact","Search By:","ContactCategory:")
Call pageCheck_WebEditOR("MasterFile","Administration - Contact"
,"ContactCategoryCode;ContactCategory")
Call pageCheck_WebElementinTable("MasterFile","Administration -
Contact","Contact Category Search Results;Contact Category;Contact Category Code
","ContactCategorySearchResults")
Call pageCheck_Image("MasterFile","Administration - Contact","Ne
w;Search;Clear","")
If Environment.Value("TestCase_Log") = "True" Then
Reporter.ReportEvent micPass,"Step 4,5:Click on
Administration Link and then Contact Category Link","The Administration Link li
st contained Contact Category, Administration - Contact Category Search screen d
isplayed with all required fields"
Else
Reporter.ReportEvent micFail,"Step 4,5:Click on
Administration Link and then Contact Category Link","The Administration Link l
ist contained Contact Category, Administration - Contact Category Search screen
displayed with all required fields"
Call captureScreenshot()
Environment.Value("TestCase_Log")="True"
End If
'Step 6
Call click_Image("MasterFile","Administration - Contact","New")
Call pageCheck_WebElementinTable("MasterFile","Contact Category
Detail","New Contact Category","NewContactCategory")
Call pageCheck_WebElementinTable("MasterFile","Contact Category
Detail","Contact Category Detail","ContactCategoryDetail")
Call pageCheck_webEditOR("MasterFile","Contact Category Detail",
"ContactCategory;ContactCategoryCode")
Call pageCheck_webListOR("MasterFile","Contact Category Detail",
"BNYCategoryFlag")
Call pageCheck_WebElementinTable("MasterFile","Contact Category
Detail","Subdepartment Contact Category Detail;Department;Subdepartment;Position
;Location","SubdepartmentContact")
Call pageCheck_webButton("MasterFile","Contact Category Detail",
"Add","")
If Environment.Value("TestCase_Log") = "True" Then
Reporter.ReportEvent micPass,"Step 6:Click New",
"Contact Category Detail screen displayed "
Else
Reporter.ReportEvent micFail,"Step 6:Click New"
,"Contact Category Detail screen displayed "
Call captureScreenshot()
Environment.Value("TestCase_Log")="True"
End If
'Step 7
Call click_Image("MasterFile","Contact Category Detail","SavePro
file")
Call ValidationErrorDetails_AllDetails("MasterFile","Contact Cat
egory Detail","Validation Error","Contact Category Code;Contact Category;BNY Cat
egory Flag","Field is required.","SubdeptContactCat")
If Environment.Value("TestCase_Log") = "True" Then
Reporter.ReportEvent micPass,"Step 7:Without ent
ering any values click Save","Validation Error window displayed with all the fi
elds "
Else
Reporter.ReportEvent micFail,"Step 7:Without en
tering any values click Save","Validation Error window displayed with all the f
ields "
Call captureScreenshot()
Environment.Value("TestCase_Log")="True"
End If
'Step 8
Call click_Image("MasterFile","Contact Category Detail","Validat
ionErrorClose")
If Environment.Value("TestCase_Log") = "True" Then
Reporter.ReportEvent micPass,"Step 8:Close the W
indow ","Window should be closed"
Else
Reporter.ReportEvent micFail,"Step 8:Close the
Window ","Window should be closed"
Call captureScreenshot()
Environment.Value("TestCase_Log")="True"
End If
'Step 9
Call set_webEdit_Value("MasterFile","Contact Category Detail","C
ontactCategory",Datatable.Value("NewContactCategory","ContactCategory"))
Call set_webEdit_Value("MasterFile","Contact Category Detail","C
ontactCategoryCode",Datatable.Value("NewContactCategoryCode","ContactCategory"))
Call select_Combo_Value("MasterFile","Contact Category Detail","
BNYCategoryFlag",Datatable.Value("BNYCategoryFlag","ContactCategory"))
Call click_Image("MasterFile","Contact Category Detail","SavePro
file")
Call pageCheck_ImageORNegitive("MasterFile","Contact Category De
tail","ValidationErrorImage")
If Environment.Value("TestCase_Log") = "True" Then
Reporter.ReportEvent micPass,"Step 9: Fill the i
nformation for Contact Category, Contact Category Code, BNY Category Flag","Deta
ils should be saved."
Else
Reporter.ReportEvent micFail,"Step 9: Fill the
information for Contact Category, Contact Category Code, BNY Category Flag","Det
ails should be saved."
Call captureScreenshot()
Environment.Value("TestCase_Log")="True"
End If
'Step 10
Call click_Image("MasterFile","Contact Category Detail","DeleteP
rofile")
If Browser("MasterFile").Dialog("Microsoft Internet Explorer").E
xist Then
Reporter.ReportEvent micPass,"Step 10:After clic
k on Delete profile,Verification for A Microsoft Pop-up stating 'Are u sure want
to delete the Profile'","Microsoft popup is appeared"
'Step 11,12
Browser("MasterFile").Dialog("Microsoft Internet
Explorer").WinButton("OK").Click
Call pageCheck_WebElementinTable("MasterFile","Administration -
Contact","Search By:","ContactCategory:")
Call MFAdminContactSearch("MasterFile","Administ
ration - Contact")
If Browser("MasterFile").Page("Administration -
Contact").WebTable("ContactCategoryResults").RowCount Then
Reporter.ReportEvent micFail,"St
ep 11,12:After click on Ok on pop up,Verification for Deletion of Added New Prof
ile","New Profile is Not Deleted"
Call captureScreenshot()
Environment.Value("Execution_Log
")="False"
Else
Reporter.ReportEvent micPass,"St
ep 11,12:After click on Ok on pop upVerification for Deletion of Added New Profi
le","New Profile is Deleted,Zero Results after Search"
End If
Else
Reporter.ReportEvent micFail,"Step 10:Verificati
on for A Microsoft Pop-up stating 'Are u sure want to delete the Profile'","Popu
p not appeared"
Call captureScreenshot()
Environment.Value("Execution_Log")="False"
End If
Call select_Menu("MasterFile","Administration - Contact","Home;D
R Home")
End Function
'*******************************************************************************
********************************************************************************
********************************************************************************
*************************************************
Public Function MFAdminContactCategory_TC6()
'Step 3
Call click_WebElement("MasterFile","Depositary Receipt Division'
s","MasterFile")
Call chkMFCAHomePage("MasterFile","MasterFile",DataTable.Value("
MenuName","HomePageVerification"),Environment.Value("NormalUser"))
If Environment.Value("TestCase_Log") = "True" Then
Reporter.ReportEvent micPass,"Step 3:Click on Ma
ster File","Master File screen is displayed with Welcome Message, Version and th
e Built Date. "
Else
Reporter.ReportEvent micFail,"Step 3:Click on M
aster File","Master File screen is displayed with Welcome Message, Version and t
he Built Date. "
Call captureScreenshot()
Environment.Value("TestCase_Log")="True"
End If
'Step 4,5
Call check_Menu("MasterFile","MasterFile",DataTable.Value("MenuP
ath","ContactCategory"))
Call select_Menu("MasterFile","MasterFile",DataTable.Value("Menu
Path","ContactCategory"))
Call pageCheck_WebElementinTable("MasterFile","Administration -
Contact","Search By:","ContactCategory:")
Call pageCheck_WebEditOR("MasterFile","Administration - Contact"
,"ContactCategoryCode;ContactCategory")
Call pageCheck_WebElementinTable("MasterFile","Administration -
Contact","Contact Category Search Results;Contact Category;Contact Category Code
","ContactCategorySearchResults")
Call pageCheck_Image("MasterFile","Administration - Contact","Ne
w;Search;Clear","")
If Environment.Value("TestCase_Log") = "True" Then
Reporter.ReportEvent micPass,"Step 4,5:Click on
Administration Link and then Contact Category Link","The Administration Link li
st contained Contact Category, Administration - Contact Category Search screen d
isplayed with all required fields"
Else
Reporter.ReportEvent micFail,"Step 4,5:Click on
Administration Link and then Contact Category Link","The Administration Link l
ist contained Contact Category, Administration - Contact Category Search screen
displayed with all required fields"
Call captureScreenshot()
Environment.Value("TestCase_Log")="True"
End If
'Step 6
Call MFAdminContactSearch("MasterFile","Administration - Contact
")
Call chkMFAdminContactSearchResult("MasterFile","Administration
- Contact")
If Environment.Value("TestCase_Log") = "True" Then
Reporter.ReportEvent micPass,"Step 6:Entering an
y input value Click Search","Contact Category Search Results table present with
the fields with all Rows related to search value "
Else
Reporter.ReportEvent micFail,"Step 6:Entering a
ny input value Click Search","Contact Category Search Results table present with
the fields with all Rows related to search value "
Call captureScreenshot()
Environment.Value("TestCase_Log")="True"
End If
'Step 7
If Browser("MasterFile").Page("Administration - Contact").WebTab
le("ContactCategoryResults").RowCount Then
strVal=Browser("MasterFile").Page("Administratio
n - Contact").WebTable("ContactCategoryResults").GetCellData(1,1)
Browser("MasterFile").Page("Administration - Con
tact").webElement("html tag:=TD","index:=0","innertext:="&strVal).click
Call PageCheck_MFAdminContactCategoryDetail("Mas
terFile","Contact Category Detail")
If Environment.Value("TestCase_Log") = "True"
Then
Reporter.ReportEvent micPass,"St
ep 7:Click any of the search result","Contact Category Opened with all req fiel
ds"
Else
Reporter.ReportEvent micFail,"S
tep 7:Click any of the search result","Contact Category Opened with all req fie
lds"
Call captureScreenshot()
Environment.Value("TestCase_Log
")="True"
End If
'Step 8
Call click_Image("MasterFile","Contact Category
Detail","RelatedProfiles")
If Browser("MasterFile").Page("Contact Category
Detail").Frame("SubDepartmentFrame").Exist Then
Reporter.ReportEvent micPass,"St
ep 8:Verification for Realated Profile Frame after click on Related Profile Butt
on","Related Profile Frame is Appearing"
Else
Reporter.ReportEvent micFail,"St
ep 8:Verification for Realated Profile Frame after click on Related Profile Butt
on","Related Profile Frame is Not Appearing"
Call captureScreenshot()
Environment.Value("Execution_Log
")="False"
End If
End If
Call select_Menu("MasterFile","Contact Category Detail","Home;DR
Home")
End Function
'*******************************************************************************
********************************************************************************
********************************************************************************
*************************************************

You might also like