Professional Documents
Culture Documents
==========================================
' 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