You are on page 1of 19

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

==========================================
' Name of the Script : Master File P
rofile Contact
' Scope of the Script : This test scr
ipt covers 9 test cases related to the MF Profile --> Contact
' Author
: Imam Shareef
' Description : Corporate Act
ions Reports Approved Events
' Date and / or Version : 05-11-2008,ve
rsion 1.0
'===============================================================
============================================
Sub MFProfileContact()
'****Declaration of Environmental Variable
Environment.Value("Execution_Log")=True
'''''''''Test case count
Const TC_COUNT = 9
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\"
'****Adding MFLogin sheet to the dataTable and Importing the Inp
ut DataTable
DataTable.AddSheet "MFLogin"
DataTable.ImportSheet strDataPath & "Login.xls","MFLogin","MFLog
in"
DataTable.AddSheet "Contact"
DataTable.ImportSheet strDataPath & "MasterFileProfile.xls","Con
tact","Contact"
DataTable.AddSheet "ReportHeader"
DataTable.ImportSheet strDataPath & "MasterFileProfile.xls","Rep
ortHeader","ReportHeader"
DataTable.AddSheet "HomePageVerification"
DataTable.ImportSheet strDataPath & "MasterFileProfile.xls","Hom
ePageVerification","HomePageVerification"
' 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
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_pas
sword","")
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")
Environment.Value("DATATABLE_ROW")=1
DataTable.GetSheet("Contact").SetCurrentRow(Environment.Value("D
ATATABLE_ROW"))
'***************************************** TC Driver Strat *****
**************************************************
For intTCCount =1 to TC_COUNT
Environment.Value("Execution_Log") = "True"
If DataTable("TestRunFlag","Contact")="Y" Then ''If run
flag is Y in test data table
Reporter.ReportEvent micDone,"######## BEGIN TEST CASE - '" & Da
taTable("TestCaseID","Contact") & "' ########### ","Execution of Test Case '" &
DataTable("TestCaseDesc","Contact") & "' Started"
strFuncName = "MFProfileContact_TC" & intTCCount & "()"
''Formation of function name
''Call Function
Execute "Call " & strFuncName
If Environment.Value("Execution_Log") = "True" Then
Call Execution_log("",Datatable.Value("TestCaseID", "Contact"),
Datatable.Value("TestCaseDesc", "Contact"), "PASS")
Else
Call Execution_log("",Datatable.Value("TestCaseID", "Contact"),
Datatable.Value("TestCaseDesc", "Contact"), "FAIL")
End If
Reporter.ReportEvent micDone,"######### END OF TEST CASE - '" &
DataTable("TestCaseID","Contact") & "###########","The Test Case Execution Compl
eted"
End If
''Increment the test data table row
strPrevious=Trim(DataTable.Value("TestCaseID","Contact"))
''Increment the test data table row
Environment.Value("DATATABLE_ROW") = Environment.Value("DATATABL
E_ROW") + 1
DataTable.GetSheet("Contact").SetCurrentRow(Environment.Value("D
ATATABLE_ROW"))
strNext=Trim(DataTable.Value("TestCaseID","Contact"))
While strPrevious = strNext
Environment.Value("DATATABLE_ROW") = Environment.Value("DATATABL
E_ROW") + 1
DataTable.GetSheet("Contact").SetCurrentRow(Environment.Value("D
ATATABLE_ROW"))
strNext=Trim(DataTable.Value("TestCaseID","Contact"))
Wend
Next
Call logoutfromApp("MasterFile","Depositary Receipt Division's")
'***************************************** TC Driver End *******
************************************************
End Sub
'**********************************************Test Case 1 to Te
st Case 9**************************************************
'----------------Test Case 1 -----------------------------
Function MFProfileContact_TC1()
'DataTable.GetSheet("Contact").SetCurrentRow(1)
Environment.Value("TestCase_Log")="True"
'Step #2
Call chkHomePage("MasterFile","Depositary Receipt Division's",Da
taTable.Value("HomePageLinks","Contact"))
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step 2: Navigate t
o DR Home page after successful login.","Successfully verified the links - " &Da
taTable.Value("HomePageLinks","Contact")
Else
Reporter.ReportEvent micFail,"Step 2: Navigate t
o DR Home page after successful login.","The links - "& DataTable.Value("HomePag
eLinks","Contact")&" are not displayed"
Environment.Value("TestCase_Log")="True"
End If
'Step #3
Call click_webElement("MasterFile","Depositary Receipt Division'
s","MasterFile")
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step 3: Click on M
asterFile in DR Home page.","Successfully verified the home page menus - " & Dat
atable.Value("MenuName","Contact")
Else
Reporter.ReportEvent micFail,"Step 3: Click onMa
sterFile in DR Home page.","The menus - '" & Datatable.Value("MenuName","Contact
") & "' are not displayed"
Environment.Value("TestCase_Log")="True"
End If
' Step #5&6
Call select_Menu("MasterFile","MasterFile",Datatable.Value("Menu
Path","Contact"))
Call pageCheck_WebElementinTable("MasterFile","Profile - Contact
Search","Contact Name;Email Address;Job Title;Status;Work Phone #" ,"")
Call pageCheck_WebEdit("MasterFile","Profile - Contact Search","
leNm_0;sdivNm_0;frstNm;lstNm", "")
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step4&5 : Under P
rofile menu select Contact.","Expected fields are displayed in search criteria"
Else
Reporter.ReportEvent micFail,"Step4&5 : Under Re
ports menu selectContact..","Expected fields are not displayed in search criteri
a"
Environment.Value("TestCase_Log")="True"
End If
Call select_Menu("MasterFile","Profile - Contact Search","HOME;D
R Home")
End Function

'----------------Test Case 2 -----------------------------


Function MFProfileContact_TC2()
'DataTable.GetSheet("Contact").SetCurrentRow(2)
Environment.Value("TestCase_Log")="True"
'Step #2
Call chkHomePage("MasterFile","Depositary Receipt Division's",Da
taTable.Value("HomePageLinks","Contact"))
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step 2: Navigate t
o DR Home page after successful login.","Successfully verified the links - " & D
ataTable.Value("HomePageLinks","Contact")
Else
Reporter.ReportEvent micFail,"Step 2: Navigate t
o DR Home page after successful login.","The links - "& DataTable.Value("HomePag
eLinks","Contact")&" are not displayed"
Environment.Value("TestCase_Log")="True"
End If
'Step #3
Call click_webElement("MasterFile","Depositary Receipt Division'
s","MasterFile")
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step 3: Click on M
asterFile in DR Home page.","Successfully verified the home page menus - " & Dat
atable.Value("MenuName","Contact")
Else
Reporter.ReportEvent micFail,"Step 3: Click onMa
sterFile in DR Home page.","The menus - '" & Datatable.Value("MenuName","Contact
") & "' are not displayed"
Environment.Value("TestCase_Log")="True"
End If
' Step #5&6
Call select_Menu("MasterFile","MasterFile",Datatable.Value("Menu
Path","Contact"))
Call pageCheck_WebElementinTable("MasterFile","Profile - Contact
Search","Contact Name;Email Address;Job Title;Status;Work Phone #" ,"")
Call pageCheck_WebEdit("MasterFile","Profile - Contact Search","
leNm_0;sdivNm_0;frstNm;lstNm", "")
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step4&5 : Under P
rofile menu select Contact.","Expected fields are displayed in search criteria"
Else
Reporter.ReportEvent micFail,"Step4&5 : Under Re
ports menu selectContact..","Expected fields are not displayed in search criteri
a"
Environment.Value("TestCase_Log")="True"
End If
'Step # 6 to 9
If (DataTable.Value("EnterpriseDetails","Contact") <> "") Then
sDetailsValue = Split(DataTable.Value("EnterpriseDetails","Conta
ct"),";",-1,1)
strSearchBy = sDetailsValue(0)
strCountry = sDetailsValue(1)
strSearch = sDetailsValue(2)
strSelectValue = sDetailsValue(3)
Call click_Image("MasterFile","Profile - Contact Search","Questi
onMark")
Call MFProfile_Contact_EnterpriseSearch( "MasterFile","Profile -
Contact Search", strSearchBy, strCountry, strSearch, strSelectValue)
Call click_Image("MasterFile","Profile - Contact Search","Sear
ch")
Call select_Menu("MasterFile","Profile - Contact Search","HOME;D
R Home")
End If
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step 6 to 9 : Ente
r a value for the Enterprise search and click on the search button.","Expected f
ields are displayed in search criteria"
Else
Reporter.ReportEvent micFail,"Step6 to 9 : Enter
a value for the Enterprise search and click on the search button.","Expected fi
elds are not displayed in search criteria"
Environment.Value("TestCase_Log")="True"
End If
End Function
'----------------Test Case 3 -----------------------------
Function MFProfileContact_TC3()
'DataTable.GetSheet("Contact").SetCurrentRow(3)
Environment.Value("TestCase_Log")="True"
'Step #2
Call chkHomePage("MasterFile","Depositary Receipt Division's",Da
taTable.Value("HomePageLinks","Contact"))
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step 2: Navigate t
o DR Home page after successful login.","Successfully verified the links - " & D
ataTable.Value("HomePageLinks","Contact")
Else
Reporter.ReportEvent micFail,"Step 2: Navigate t
o DR Home page after successful login.","The links - "& DataTable.Value("HomePag
eLinks","Contact")&" are not displayed"
Environment.Value("TestCase_Log")="True"
End If
'Step #3
Call click_webElement("MasterFile","Depositary Receipt Division'
s","MasterFile")
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step 3: Click on M
asterFile in DR Home page.","Successfully verified the home page menus - " & Dat
atable.Value("MenuName","Contact")
Else
Reporter.ReportEvent micFail,"Step 3: Click onMa
sterFile in DR Home page.","The menus - '" & Datatable.Value("MenuName","Contact
") & "' are not displayed"
Environment.Value("TestCase_Log")="True"
End If
'Step #5&6
Call select_Menu("MasterFile","MasterFile",Datatable.Value("Menu
Path","Contact"))
Call pageCheck_WebElementinTable("MasterFile","Profile - Contact
Search","Contact Name;Email Address;Job Title;Status;Work Phone #" ,"")
Call pageCheck_WebEdit("MasterFile","Profile - Contact Search","
leNm_0;sdivNm_0;frstNm;lstNm", "")
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step4&5 : Under P
rofile menu select Contact.","Expected fields are displayed in search criteria"
Else
Reporter.ReportEvent micFail,"Step4&5 : Under Re
ports menu selectContact..","Expected fields are not displayed in search criteri
a"
Environment.Value("TestCase_Log")="True"
End If
'Step #6 to 9
If (DataTable.Value("CompanyDetails","Contact") <> "") Then
sDetailsValue = Split(DataTable.Value("CompanyDetails","Contact"
),";",-1,1)
strType = sDetailsValue(0)
strCountryofInc = sDetailsValue(1)
strSearchBy = sDetailsValue(2)
strSearch = sDetailsValue(3)
strSelectValue = sDetailsValue(4)
Call click_Image("MasterFile","Profile - Contact Search","Questi
onMark6")
Call MFProfile_Contact_CompanySearch( "MasterFile","Profile - Co
ntact Search",strType, strCountryofInc, strSearchBy,strSearch, strSelectValue)
Call click_Image("MasterFile","Profile - Contact Search","Sear
ch")
Call select_Menu("MasterFile","Profile - Contact Search","HOME;D
R Home")
End If
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step 6 to 9 : Ente
r a value for the CompanySearch and click on the search button.","Expected field
s are displayed in search criteria"
Else
Reporter.ReportEvent micFail,"Step6 to 9 : Enter
a value for the CompanySearch and click on the search button.","Expected fields
are not displayed in search criteria"
Environment.Value("TestCase_Log")="True"
End If
End Function

'----------------Test Case 4 -----------------------------


Function MFProfileContact_TC4()
'DataTable.GetSheet("Contact").SetCurrentRow(4)
Environment.Value("TestCase_Log")="True"
'Step #2
Call chkHomePage("MasterFile","Depositary Receipt Division's",Da
taTable.Value("HomePageLinks","Contact"))
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step 2: Navigate t
o DR Home page after successful login.","Successfully verified the links - " & D
ataTable.Value("HomePageLinks","Contact")
Else
Reporter.ReportEvent micFail,"Step 2: Navigate t
o DR Home page after successful login.","The links - "& DataTable.Value("HomePag
eLinks","Contact")&" are not displayed"
Environment.Value("TestCase_Log")="True"
End If
'Step #3
Call click_webElement("MasterFile","Depositary Receipt Division'
s","MasterFile")
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step 3: Click on MasterFile in DR
Home page.","Successfully verified the home page menus - " & Datatable.Value("Me
nuName","Contact")
Else
Reporter.ReportEvent micFail,"Step 3: Click onMasterFile in DR H
ome page.","The menus - '" & Datatable.Value("MenuName","Contact") & "' are not
displayed"
Environment.Value("TestCase_Log")="True"
End If
'Step #5&6
Call select_Menu("MasterFile","MasterFile",Datatable.Value("Menu
Path","Contact"))
Call pageCheck_WebElementinTable("MasterFile","Profile - Contact
Search","Contact Name;Email Address;Job Title;Status;Work Phone #" ,"")
Call pageCheck_WebEdit("MasterFile","Profile - Contact Search","
leNm_0;sdivNm_0;frstNm;lstNm", "")
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step4&5 : Under P
rofile menu select Contact.","Expected fields are displayed in search criteria"
Else
Reporter.ReportEvent micFail,"Step4&5 : Under Re
ports menu selectContact..","Expected fields are not displayed in search criteri
a"
Environment.Value("TestCase_Log")="True"
End If
'Step #6 to 9
If (DataTable.Value("EnterpriseDetails","Contact") <> "") Then
sDetailsValue = Split(DataTable.Value("EnterpriseDetails","Conta
ct"),";",-1,1)
strSearchBy = sDetailsValue(0)
strCountry = sDetailsValue(1)
strSearch = sDetailsValue(2)
strSelectValue = sDetailsValue(3)
Call click_Image( "MasterFile","Profile - Contact Search","Quest
ionMark")
Call MFProfile_Contact_EnterpriseSearch( "MasterFile","Profile -
Contact Search", strSearchBy, strCountry, strSearch, strSelectValue)
Call click_Image("MasterFile","Profile - Contact Search","Sear
ch")
End If
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step6 to 9 : Enter
a value for the Enterprise search and click on the search button.","Expected fi
elds are displayed in search criteria"
Else
Reporter.ReportEvent micFail,"Step6 to 9 : Enter
a value for the Enterprise search and click on the search button.","Expected fi
elds are not displayed in search criteria"
Environment.Value("TestCase_Log")="True"
End If
'Step #10to17
Call click_Image("MasterFile","Profile - Contact Search","Pencil
Icon")
Call MF_Profile_ContactFillDetailsTab("MasterFile","Contact Prof
ile")
Call selectTab("MasterFile","Contact Profile","Enterprise")
Call MF_Profile_ContactFillEnterpriseTab("MasterFile","Contact P
rofile")
Call selectTab("MasterFile","Contact Profile"," Company/ Roles
")
Call MF_Profile_ContactFillCompanyRolesTab("MasterFile","Contact
Profile")
Call selectTab("MasterFile","Contact Profile","Products")
Call MF_Profile_ContactProductsTab("MasterFile","Contact Profile
")
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step 10 to 17: Ent
er a value for the Enterprise search and click on the search button.","Expected
fields are displayed in search criteria"
Else
Reporter.ReportEvent micFail,"Step10 to 17: Ente
r a value for the Enterprise search and click on the search button.","Expected f
ields are not displayed in search criteria"
Environment.Value("TestCase_Log")="True"
End If
Call select_Menu("MasterFile","Contact Profile","HOME;DR Home")
End Function
'----------------Test Case 5 -----------------------------
Function MFProfileContact_TC5()
'DataTable.GetSheet("Contact").SetCurrentRow(5)
Environment.Value("TestCase_Log")="True"
'Step #2
Call chkHomePage("MasterFile","Depositary Receipt Division's",Da
taTable.Value("HomePageLinks","Contact"))
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step 2: Navigate t
o DR Home page after successful login.","Successfully verified the links - " & D
ataTable.Value("HomePageLinks","Contact")
Else
Reporter.ReportEvent micFail,"Step 2: Navigate t
o DR Home page after successful login.","The links - "& DataTable.Value("HomePag
eLinks","Contact")&" are not displayed"
Environment.Value("TestCase_Log")="True"
End If
'Step #3
Call click_webElement("MasterFile","Depositary Receipt Division'
s","MasterFile")
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step 3: Click on M
asterFile in DR Home page.","Successfully verified the home page menus - " & Dat
atable.Value("MenuName","Contact")
Else
Reporter.ReportEvent micFail,"Step 3: Click onMa
sterFile in DR Home page.","The menus - '" & Datatable.Value("MenuName","Contact
") & "' are not displayed"
Environment.Value("TestCase_Log")="True"
End If
'Step #5&6
Call select_Menu("MasterFile","MasterFile",Datatable.Value("Menu
Path","Contact"))
Call pageCheck_WebElementinTable("MasterFile","Profile - Contact
Search","Contact Name;Email Address;Job Title;Status;Work Phone #" ,"")
Call pageCheck_WebEdit("MasterFile","Profile - Contact Search","
leNm_0;sdivNm_0;frstNm;lstNm", "")
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step4&5 : Under P
rofile menu select Contact.","Expected fields are displayed in search criteria"
Else
Reporter.ReportEvent micFail,"Step4&5 : Under Re
ports menu selectContact..","Expected fields are not displayed in search criteri
a"
Environment.Value("TestCase_Log")="True"
End If
'Step #6 t0 9
If (DataTable.Value("EnterpriseDetails","Contact") <> "") Then
sDetailsValue = Split(DataTable.Value("EnterpriseDetails","Conta
ct"),";",-1,1)
strSearchBy = sDetailsValue(0)
strCountry = sDetailsValue(1)
strSearch = sDetailsValue(2)
strSelectValue = sDetailsValue(3)
Call click_Image("MasterFile","Profile - Contact Search","Questi
onMark")
Call MFProfile_Contact_EnterpriseSearch( "MasterFile","Profile -
Contact Search", strSearchBy, strCountry, strSearch, strSelectValue)
Call click_Image("MasterFile","Profile - Contact Search","Sear
ch")
End If
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step 6 t09 : Enter
a value for the Enterprise search and click on the search button.","Expected fi
elds are displayed in search criteria"
Else
Reporter.ReportEvent micFail,"Step6 t0 9: Enter
a value for the Enterprise search and click on the search button.","Expected fie
lds are not displayed in search criteria"
Environment.Value("TestCase_Log")="True"
End If
'Step #10 to 12
Call click_Image("MasterFile","Profile - Contact Search","Pencil
Icon")
Call MF_Profile_ContactFillDetailsTab_Error("MasterFile","Contac
t Profile")
Call selectTab("MasterFile","Contact Profile","Enterprise")
Call MF_Profile_ContactFillEnterpriseTab_Error("MasterFile","Con
tact Profile")
Call selectTab("MasterFile","Contact Profile"," Company/ Roles
")
Call MF_Profile_ContactFillCompanyRolesTab("MasterFile","Contact
Profile")
Call selectTab("MasterFile","Contact Profile","Products")
Call MF_Profile_ContactProductsTab("MasterFile","Contact Profile
")
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step 10 to12 : En
ter a value for the Enterprise search and click on the search button.","Expected
fields are displayed in search criteria"
Else
Reporter.ReportEvent micFail,"Step10 to12: Enter
a value for the Enterprise search and click on the search button.","Expected fi
elds are not displayed in search criteria"
Environment.Value("TestCase_Log")="True"
End If
Call select_Menu("MasterFile","Contact Profile","HOME;DR Home")
End Function
'----------------Test Case 6 -----------------------------
Function MFProfileContact_TC6()
' DataTable.GetSheet("Contact").SetCurrentRow(6)
Environment.Value("TestCase_Log")="True"
'Step #2
Call chkHomePage("MasterFile","Depositary Receipt Division's",Da
taTable.Value("HomePageLinks","Contact"))
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step 2: Navigate t
o DR Home page after successful login.","Successfully verified the links - " &Da
taTable.Value("HomePageLinks","Contact")
Else
Reporter.ReportEvent micFail,"Step 2: Navigate t
o DR Home page after successful login.","The links - "& DataTable.Value("HomePag
eLinks","Contact")&" are not displayed"
Environment.Value("TestCase_Log")="True"
End If
'Step #3
Call click_webElement("MasterFile","Depositary Receipt Division'
s","MasterFile")
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step 3: Click on M
asterFile in DR Home page.","Successfully verified the home page menus - " & Dat
atable.Value("MenuName","Contact")
Else
Reporter.ReportEvent micFail,"Step 3: Click onMa
sterFile in DR Home page.","The menus - '" & Datatable.Value("MenuName","Contact
") & "' are not displayed"
Environment.Value("TestCase_Log")="True"
End If
'Step #4
Call select_Menu("MasterFile","MasterFile",Datatable.Value("Menu
Path","Contact"))
Call pageCheck_WebElementinTable("MasterFile","Profile - Contact
Search","Contact Name;Email Address;Job Title;Status;Work Phone #" ,"")
Call pageCheck_WebEdit("MasterFile","Profile - Contact Search","
leNm_0;sdivNm_0;frstNm;lstNm", "")
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step4 : Under Prof
ile menu select Contact.","Expected fields are displayed in search criteria"
Else
Reporter.ReportEvent micFail,"Step4 : Under Repo
rts menu selectContact..","Expected fields are not displayed in search criteria"
Environment.Value("TestCase_Log")="True"
End If
' Step #5
If DataTable("FirstName_Search","Contact") <> "" Then
Call set_WebEdit_Value("MasterFile","Profile - Contact Search","
FirstName",DataTable("FirstName_Search","Contact"))
Call click_Image("MasterFile","Profile - Contact Search","Search
")
End If
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step5 : Enter the
Values For the FirstName Field.","Expected fields are displayed in search crit
eria"
Else
Reporter.ReportEvent micFail,"Step5 : Enter the
Values For the FirstName Field.","Expected fields are not displayed in search c
riteria"
Environment.Value("TestCase_Log")="True"
End If
End Function
'----------------Test Case 7 -----------------------------
Function MFProfileContact_TC7()
' DataTable.GetSheet("Contact").SetCurrentRow(7)
Environment.Value("TestCase_Log")="True"
'Step #1
Call click_Image("MasterFile","Profile - Contact Search","Clear"
)
'Step #2
If DataTable("LastName_Search","Contact") <> "" Then
Call set_WebEdit_Value("MasterFile","Profile - Contact Search","
LastName",DataTable("LastName_Search","Contact"))
End If
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step2 : Enter the
Values For the LastName Field.","Expected fields are displayed in search criter
ia"
Else
Reporter.ReportEvent micFail,"Step2 : Enter the
Values For the LastName Field.","Expected fields are not displayed in search cr
iteria"
Environment.Value("TestCase_Log")="True"
End If
Call click_Image("MasterFile","Profile - Contact Search","Search
")
Call select_Menu("MasterFile","Profile - Contact Search","HOME;D
R Home")
End Function

'----------------Test Case 8 -----------------------------


Function MFProfileContact_TC8()
' DataTable.GetSheet("Contact").SetCurrentRow(8)
Environment.Value("TestCase_Log")="True"
'TC#2
Call chkHomePage("MasterFile","Depositary Receipt Division's",Da
taTable.Value("HomePageLinks","Contact"))
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step 2: Navigate t
o DR Home page after successful login.","Successfully verified the links - " & D
ataTable.Value("HomePageLinks","Contact")
Else
Reporter.ReportEvent micFail,"Step 2: Navigate t
o DR Home page after successful login.","The links - "& DataTable.Value("HomePag
eLinks","Contact")&" are not displayed"
Environment.Value("TestCase_Log")="True"
End If
Call click_webElement("MasterFile","Depositary Receipt Division'
s","MasterFile")
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step 3: Click on M
asterFile in DR Home page.","Successfully verified the home page menus - " & Dat
atable.Value("MenuName","Contact")
Else
Reporter.ReportEvent micFail,"Step 3: Click onMa
sterFile in DR Home page.","The menus - '" & Datatable.Value("MenuName","Contact
") & "' are not displayed"
Environment.Value("TestCase_Log")="True"
End If
Call select_Menu("MasterFile","MasterFile",Datatable.Value("Menu
Path","Contact"))
Call pageCheck_WebElementinTable("MasterFile","Profile - Contact
Search","Contact Name;Email Address;Job Title;Status;Work Phone #" ,"")
Call pageCheck_WebEdit("MasterFile","Profile - Contact Search","
leNm_0;sdivNm_0;frstNm;lstNm", "")
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step4&5 : Under
Profile menu select Contact.","Expected fields are displayed in search criteria"
Else
Reporter.ReportEvent micFail,"Step4&5 : Under Re
ports menu selectContact..","Expected fields are not displayed in search criteri
a"
Environment.Value("TestCase_Log")="True"
End If
If (DataTable.Value("EnterpriseDetails","Contact") <> "") Then
sDetailsValue = Split(DataTable.Value("EnterpriseDetails","Conta
ct"),";",-1,1)
strSearchBy = sDetailsValue(0)
strCountry = sDetailsValue(1)
strSearch = sDetailsValue(2)
strSelectValue = sDetailsValue(3)
Call click_Image("MasterFile","Profile - Contact Search","Questi
onMark")
Call MFProfile_Contact_EnterpriseSearch( "MasterFile","Profile -
Contact Search", strSearchBy, strCountry, strSearch, strSelectValue)
Call click_Image("MasterFile","Profile - Contact Search","Sear
ch")
End If
'Step#1
Call SelectValueinTable("MasterFile","Profile - Contact Search"
,"Contact Search Results"," Shareef, Imam M.D.")
Call pageCheck_Image("MasterFile","Contact Profile","Preview Pr
ofile;Delete Profile;Save Profile","")
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step 1 : Enter a v
alue for the Enterprise search and click on the ContactNameLink.","Expected fiel
ds are displayed in search criteria"
Else
Reporter.ReportEvent micFail,"Step1 : Enter a va
lue for the Enterprise search andclick on the ContactNameLink.","Expected fields
are not displayed in search criteria"
Environment.Value("TestCase_Log")="True"
End If
'Step#2
Call click_Image("MasterFile","Contact Profile","Preview Profil
e")
If Browser("MasterFile").Page("Contact Profile").Frame("Frame").
WebTable("Contact Company Link Detail").Exist and Browser("MasterFile").Page("Co
ntact Profile").Frame("Frame").WebTable("Contact Detail").Exist and Browser("Mas
terFile").Page("Contact Profile").Frame("Frame").WebTable("Contact Enterprise Li
nk").Exist and Browser("MasterFile").Page("Contact Profile").Frame("Frame").WebT
able("Communication Set Details").Exist Then
Environment.Value("TestCase_Log")="True"
Reporter.ReportEvent micPass,"Step 2 : Click on
the Preview button. ","Expected fields are displayed in search criteria"
Else
Reporter.ReportEvent micFail,"Step2: Click on th
e Preview button. ","Expected fields are not displayed in search criteria"
Environment.Value("TestCase_Log")="True"
End If
'Step#3
Browser("MasterFile").Page("Contact Profile").Frame("Frame").Ima
ge("Print Profile").Click
If Dialog("Print").Exist Then
Dialog("Print").Close
Reporter.ReportEvent micPass,"Step 3 : Click on
the Print button. ","The Print Dialog Box should be displayed."
Reporter.ReportEvent micPass,"Step 3 : Click on
the Print button. ","The details printed Should be Checked Manually"
Else
Reporter.ReportEvent micFail,"Step2: Click on th
e Print button. ","The Print Dialog Box should is not displayed."
Environment.Value("TestCase_Log")="True"
End If
'Step#4
Browser("MasterFile").Page("Contact Profile").Frame("Frame").Ima
ge("Back").Click
Environment.Value("TestCase_Log")="True"
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step 4 : Click on
the Back button. ","The user should be transferred to the previous view."
Else
Reporter.ReportEvent micFail,"Step4: Click on th
e Back button. ","The user should be transferred to the previous view."
Environment.Value("TestCase_Log")="True"
End If
'Step#5 To 8
Call select_Menu("MasterFile","Contact Profile",Datatable.Value(
"MenuPath","Contact"))
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step5 To 8 : Under
Profile menu select Contact.","Expected fields are displayed in search criteria
"
Else
Reporter.ReportEvent micFail,"Step5 To 8 : Under
Reports menu selectContact..","Expected fields are not displayed in search crit
eria"
Environment.Value("TestCase_Log")="True"
End If
If (DataTable.Value("EnterpriseDetails","Contact") <> "") Then
sDetailsValue = Split(DataTable.Value("EnterpriseDetails","Conta
ct"),";",-1,1)
strSearchBy = sDetailsValue(0)
strCountry = sDetailsValue(1)
strSearch = sDetailsValue(2)
strSelectValue = sDetailsValue(3)
Call click_Image("MasterFile","Profile - Contact Search","Questi
onMark")
Call MFProfile_Contact_EnterpriseSearch( "MasterFile","Profile -
Contact Search", strSearchBy, strCountry, strSearch, strSelectValue)
Call click_Image("MasterFile","Profile - Contact Search","Sear
ch")
End If
'Step#9
Call SelectValueinTable("MasterFile","Profile - Contact Search"
,"Contact Search Results"," Shareef, Imam M.D.")
Call pageCheck_Image("MasterFile","Contact Profile","Preview Pr
ofile;Delete Profile;Save Profile","")
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step 9 : Enter a v
alue for the Enterprise search and click on the ContactNameLink.","Expected fiel
ds are displayed in search criteria"
Else
Reporter.ReportEvent micFail,"Step9 : Enter a va
lue for the Enterprise search andclick on the ContactNameLink.","Expected fields
are not displayed in search criteria"
Environment.Value("TestCase_Log")="True"
End If
'Step#10
Call click_Image("MasterFile","Contact Profile","Delete Profile
")
Browser("MasterFile").Dialog("Microsoft Internet Explorer").WinB
utton("OK").Click
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step 10 : Click on
theDelete button. ","The contact Profile should be deleted.."
Else
Reporter.ReportEvent micFail,"Step10: Click on t
he Delete button. ","The contact Profile is not be deleted."
Environment.Value("TestCase_Log")="True"
End If
Call select_Menu("MasterFile","Profile - Contact Search","HOME;D
R Home")
End Function
'----------------Test Case 9 -----------------------------
Function MFProfileContact_TC9()
'DataTable.GetSheet("Contact").SetCurrentRow(9)
Environment.Value("TestCase_Log")="True"
'Step #1
Call chkHomePage("MasterFile","Depositary Receipt Division's",Da
taTable.Value("HomePageLinks","Contact"))
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step 1: Navigate t
o DR Home page after successful login.","Successfully verified the links - " & D
ataTable.Value("HomePageLinks","Contact")
Else
Reporter.ReportEvent micFail,"Step 1: Navigate t
o DR Home page after successful login.","The links - "& DataTable.Value("HomePag
eLinks","Contact")&" are not displayed"
Environment.Value("TestCase_Log")="True"
End If
'Step #2
Call click_webElement("MasterFile","Depositary Receipt Division'
s","MasterFile")
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step2 : Click on
MasterFile in DR Home page.","Successfully verified the home page menus - " & Da
tatable.Value("MenuName","Contact")
Else
Reporter.ReportEvent micFail,"Step 2: Click onMa
sterFile in DR Home page.","The menus - '" & Datatable.Value("MenuName","Contact
") & "' are not displayed"
Environment.Value("TestCase_Log")="True"
End If
' Step #3
Call select_Menu("MasterFile","MasterFile",Datatable.Value("Menu
Path","Contact"))
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step3 : Under Profile menu select
Contact.","Expected fields are displayed in search criteria"
Else
Reporter.ReportEvent micFail,"Step3 : Under Repo
rts menu selectContact..","Expected fields are not displayed in search criteria"
Environment.Value("TestCase_Log")="True"
End If
'Step #4&5
If DataTable("ContactStatus","Contact") <> "" Then
Call Select_Combo_Value("MasterFile","Profile - Contact Search",
"ContactStatus",DataTable("ContactStatus","Contact"))
End If
If (DataTable.Value("CompanyDetails","Contact") <> "") Then
sDetailsValue = Split(DataTable.Value("CompanyDetails","
Contact"),";",-1,1)
strType = sDetailsValue(0)
strCountryofInc = sDetailsValue(1)
strSearchBy = sDetailsValue(2)
strSearch = sDetailsValue(3)
strSelectValue = sDetailsValue(4)
Call click_Image("MasterFile","Profile - Contact Search"
,"QuestionMark6")
Call MFProfile_Contact_CompanySearch( "MasterFile","Prof
ile - Contact Search",strType, strCountryofInc, strSearchBy,strSearch, strSelect
Value)
Call click_Image("MasterFile","Profile - Contact Searc
h","Search")
End If
intprofileCount = 0
intRC = Browser("MasterFile").Page("Profile - Contact Search").W
ebTable("Contact Search Results").RowCount
For intCounter = 1 to intRC
strCellData = Browser("MasterFile").Page("Profile - Cont
act Search").WebTable("Contact Search Results").GetCellData(intCounter, 2)
If (strCellData <> "") And (Instr(strCellData, "ERROR:")
= 0) Then
intprofileCount = intprofileCount + 1
End If
Next
intProfileCount= intprofileCount-1
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step4&5 : After C
licking on the Click Verify the Number of Records.","The Number of Records avali
able are counted"
Else
Reporter.ReportEvent micFail,"Step4&5 :After Cli
cking on the Click Verify the Number of Records..","The Number of Records avalia
ble are not counted"
Environment.Value("TestCase_Log")="True"
End If
'Step#6
Call select_Menu("MasterFile","Profile - Contact Search",Datatab
le.Value("MenuPath_Reports","Contact"))
If DataTable("CompanyName_Reports","Contact") <> "" Then
Call set_WebEdit_Value("MasterFile","Reports - Contact S
earch","CompanyName",DataTable("CompanyName_Reports","Contact"))
Call click_Image("MasterFile","Reports - Contact Searc
h","Search")
Wait (2)
intreportCount= Browser("MasterFile").Page("Reports - Co
ntact Search Results").WebTable("Item").Rowcount
intReportcount=intreportCount-1
End If
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step6 : Under Rep
orts menu select Contact.","The User is Transfered to the Reports Search Screen
Page"
Else
Reporter.ReportEvent micFail,"Step6 : Under Repo
rts menu selectContact..","The User is Not Transfered to the Reports Search Scre
en Page"
Environment.Value("TestCase_Log")="True"
End If
'Step#7
If (intProfileCount = intReportcount) Then
Environment.Value("TestCase_Log")="True"
Reporter.ReportEvent micPass,"Step 7: Verfiying if the N
umber of Records Displayed for Companyname is Same in Profile --> Contact and
Reports --> Contact","The Number of Records dispalyed ForContact Name in Profile
ContactFor " & DataTable.Value("CompanyName_Reports","Contact") & " (" & intPro
fileCount & ") are equal to Those Displayed in Reports Contact " & "(" & intRep
ortcount & ")"
Else
Reporter.ReportEvent micFail,"Step 7: Verfiying if the N
umber of Records Displayed for Companyname is Same in Profile --> Contact and
Reports --> Contact","The Number of Records dispalyed ForContact Name in Profile
ContactFor " & DataTable.Value("CompanyName_Reports","Contact") & " (" & intPro
fileCount & ") are not equal to Those Displayed in Reports Contact " & "(" & in
tReportcount & ")"
Environment.Value("Execution_Log") = False
End If
'Step#8&9
Call select_Menu("MasterFile","Reports - Contact Search Results"
,Datatable.Value("MenuPath","Contact"))
If DataTable("FirstName_Search","Contact") <> "" Then
Call set_WebEdit_Value("MasterFile","Profile - Contact S
earch","FirstName",DataTable("FirstName_Search","Contact"))
Call click_Image("MasterFile","Profile - Contact Search"
,"Search")
End If
intprofileCount = 0
intRC = Browser("MasterFile").Page("Profile - Contact Search").W
ebTable("Contact Search Results").RowCount
For intCounter = 1 to intRC
strCellData = Browser("MasterFile").Page("Profile - Cont
act Search").WebTable("Contact Search Results").GetCellData(intCounter, 2)
If (strCellData <> "") And (Instr(strCellData, "ERROR:")
= 0) Then
intprofileCount = intprofileCount + 1
End If
Next
intProfileCount= intprofileCount-1
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step8&9 : Enter t
he Value for the First Name Field .After Clicking on the Search Verify the Numbe
r of Records.","The Number of Records avaliable are counted"
Else
Reporter.ReportEvent micFail,"Step8&9 :Enter the
Value for the First Name Field .After Clicking on the Search Verify the Number
of Records..","The Number of Records avaliable are not counted"
Environment.Value("TestCase_Log")="True"
End If
'Step#10
Call select_Menu("MasterFile","Profile - Contact Search",Datatab
le.Value("MenuPath_Reports","Contact"))
If DataTable("ContactFirstName_Reports","Contact") <> "" Then
Call set_WebEdit_Value("MasterFile","Reports - Contact S
earch","ContactFirstName",DataTable("ContactFirstName_Reports","Contact"))
Call click_Image("MasterFile","Reports - Contact Searc
h","Search")
Call ReportLoadWait("MasterFile","Reports - Contact Sear
ch Results","Item","Item")
intreportCount= Browser("MasterFile").Page("Reports - Co
ntact Search Results").WebTable("Item").Rowcount
intReportcount=intreportCount-1
End If
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step10 : Under Re
ports menu select Contact.","The User is Transfered to the Reports Search Screen
Page"
Else
Reporter.ReportEvent micFail,"Step10 : Under Rep
orts menu selectContact..","The User is Not Transfered to the Reports Search Scr
een Page"
Environment.Value("TestCase_Log")="True"
End If
'Step#11
If (intProfileCount = intReportcount) Then
Environment.Value("TestCase_Log")="True"
Reporter.ReportEvent micPass,"Step 11: Verfiying if the
Number of Records Displayed for Companyname is Same in Profile --> Contact and
Reports --> Contact","The Number of Records dispalyed ForContact Name in Profil
e ContactFor " & DataTable.Value("ContactFirstName_Reports","Contact") & " (" &
intProfileCount & ") are equal to Those Displayed in Reports Contact " & "(" &
intReportcount & ")"
Else
Reporter.ReportEvent micFail,"Step 11: Verfiying if the
Number of Records Displayed for Companyname is Same in Profile --> Contact and
Reports --> Contact","The Number of Records dispalyed ForContact Name in Profil
e ContactFor " & DataTable.Value("ContactFirstName_Reports","Contact") & " (" &
intProfileCount & ") are not equal to Those Displayed in Reports Contact " & "(
" & intReportcount & ")"
Environment.Value("Execution_Log") = False
End If
'Step#12&13
Call select_Menu("MasterFile","Reports - Contact Search Results"
,Datatable.Value("MenuPath","Contact"))
If DataTable("LastName_Search","Contact") <> "" Then
Call set_WebEdit_Value("MasterFile","Profile - Contact Search","
LastName",DataTable("LastName_Search","Contact"))
Call click_Image("MasterFile","Profile - Contact Search","Search
")
End If
intprofileCount = 0
intRC = Browser("MasterFile").Page("Profile - Contact Search").W
ebTable("Contact Search Results").RowCount
For intCounter = 1 to intRC
strCellData = Browser("MasterFile").Page("Profile - Cont
act Search").WebTable("Contact Search Results").GetCellData(intCounter, 2)
If (strCellData <> "") And (Instr(strCellData, "ERROR:")
= 0) Then
intprofileCount = intprofileCount + 1
End If
Next
intProfileCount= intprofileCount-1
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step12&13 : Enter
the Value for the Last Name Field .After Clicking on the Search Verify the Numbe
r of Records.","The Number of Records avaliable are counted"
Else
Reporter.ReportEvent micFail,"Step12&13 :Enter t
he Value for the Last Name Field .After Clicking on the Search Verify the Number
of Records..","The Number of Records avaliable are not counted"
Environment.Value("TestCase_Log")="True"
End If
'Step#14
Call select_Menu("MasterFile","Profile - Contact Search",Datatab
le.Value("MenuPath_Reports","Contact"))
If DataTable("ContactLastName_Reports","Contact") <> "" Then
Call set_WebEdit_Value("MasterFile","Reports - Contact Search","
ContactLastName",DataTable("ContactLastName_Reports","Contact"))
Call click_Image("MasterFile","Reports - Contact Search","Sear
ch")
Call ReportLoadWait("MasterFile","Reports - Contact Search Resul
ts","Item","Item")
intreportCount= Browser("MasterFile").Page("Reports - Contact Se
arch Results").WebTable("Item").Rowcount
intReportcount=intreportCount-1
End If
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step14 : Under Rep
orts menu select Contact.","The User is Transfered to the Reports Search Screen
Page"
Else
Reporter.ReportEvent micFail,"Step14 : Under Rep
orts menu selectContact..","The User is Not Transfered to the Reports Search Scr
een Page"
Environment.Value("TestCase_Log")="True"
End If
'Step#15
If (intProfileCount = intReportcount) Then
Environment.Value("TestCase_Log")="True"
Reporter.ReportEvent micPass,"Step 15: Verfiying
if the Number of Records Displayed for Companyname is Same in Profile --> Con
tact and Reports --> Contact","The Number of Records dispalyed ForContact Name i
n Profile ContactFor " & DataTable.Value("ContactLastName_Reports","Contact") &
" (" & intProfileCount & ") are equal to Those Displayed in Reports Contact " &
"(" & intReportcount & ")"
Else
Reporter.ReportEvent micFail,"Step 15: Verfiying
if the Number of Records Displayed for Companyname is Same in Profile --> Con
tact and Reports --> Contact","The Number of Records dispalyed ForContact Name i
n Profile ContactFor " & DataTable.Value("ContactLastName_Reports","Contact") &
" (" & intProfileCount & ") are not equal to Those Displayed in Reports Contact
" & "(" & intReportcount & ")"
Environment.Value("Execution_Log") = False
End If
'Step#16
Call select_Menu("MasterFile","Reports - Contact Search Results"
,"HOME;DR Home")
If Environment.Value("TestCase_Log")="True" Then
Reporter.ReportEvent micPass,"Step16 : Under Hom
e menu select DRHome.","The User is Transfered to the Master File page"
Else
Reporter.ReportEvent micFail,"Step16 : Under Hom
e menu select DRHome.","The User is Not Transfered to the Master File page"
Environment.Value("TestCase_Log")="True"
End If
End Function

You might also like