You are on page 1of 8

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

==========================
' Name of the Script : MFReportsPerfThreshold
' Scope of the Script : This test script covers 1
1 test cases related to MF Reports Perf & Threshold Pricing Search
' Author :Satish Dupati
' Description : MF Reports
Perf & Threshold Pricing Search ,Sorting and Filtering the results
' Date and / or Version : 03-12-2008,ver
sion 1.0
'===============================================================================
============================
Sub MFReportsPerfThreshold()
'****Declaration of Environmental Variable
Environment.Value("Execution_Log")=True
'''''''''Test case count
Const TC_COUNT =11
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 "PerfThresholdPricing"
DataTable.ImportSheet strDataPath & "MasterFileReports.xls","Per
fThresholdPricing","PerfThresholdPricing"
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_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")
Call chkHomePage("MasterFile","Depositary Receipt Division's",Da
taTable.Value("HomePageLinks","HomePageVerification"))
Environment.Value("DATATABLE_ROW")=1
DataTable.GetSheet("PerfThresholdPricing").SetCurrentRow(Environ
ment.Value("DATATABLE_ROW"))
'***************************************** TC Driver Strat *****
**************************************************
For intTCCount = 1 to TC_COUNT
Environment.Value("Execution_Log") = "True"
If DataTable("TestRunFlag","PerfThresholdPricing") = "Y"
Then ''If run flag is Y in test data table
Reporter.ReportEvent micDone,"######## BEGIN TEST CASE - '" & Da
taTable("TestCaseID","PerfThresholdPricing") & "' ########### ","Execution of Te
st Case '" & DataTable("TestCaseDesc","PerfThresholdPricing") & "' Started"
strFuncName = "MFReportsPerfThreshold_TC" & intTCCount & "()"
''Formation of function name
''Call Function
'msgbox strFuncName
Execute "Call " & strFuncName
If Environment.Value("Execution_Log") = "True"
Then
Call Execution_log("",Datatable.
Value("TestCaseID", "PerfThresholdPricing"), Datatable.Value("TestCaseDesc", "Pe
rfThresholdPricing"), "PASS")
Else
Call Execution_log("",Datatable.
Value("TestCaseID", "PerfThresholdPricing"), Datatable.Value("TestCaseDesc", "Pe
rfThresholdPricing"), "FAIL")
End If
Reporter.ReportEvent micDone,"######### END OF T
EST CASE - '" & DataTable("TestCaseID","PerfThresholdPricing") & "###########","
The Test Case Execution Completed"
End If
strPrevious=Trim(DataTable.Value("TestCaseID","PerfThres
holdPricing"))
''Increment the test data table row
Environment.Value("DATATABLE_ROW") = Environment.Value("
DATATABLE_ROW") + 1
DataTable.GetSheet("PerfThresholdPricing").SetCurrentRow
(Environment.Value("DATATABLE_ROW"))
strNext=Trim(DataTable.Value("TestCaseID","PerfThreshold
Pricing"))
While strPrevious = strNext
Environment.Value("DATATABLE_ROW") = Environment.Value
("DATATABLE_ROW") + 1
DataTable.GetSheet("PerfThresholdPricing").SetCurrentR
ow(Environment.Value("DATATABLE_ROW"))
strNext=Trim(DataTable.Value("TestCaseID","PerfThresho
ldPricing"))
Wend
Next
Call logoutfromApp("MasterFile","Depositary Receipt Division's")
'***************************************** TC Driver End ***************
****************************************

End Sub
'**********************************************Test Case 1 to Test Case 11******
********************************************
'===============================================================================
==========
Public Function MFReportsPerfThreshold_TC1()
'Step 3
Call click_WebElement("MasterFile","Depositary Receipt Division'
s","MasterFile")
'Step 4,5
Call select_Menu("MasterFile","MasterFile",DataTable.Value("Menu
Path","PerfThresholdPricing"))
Call pageCheck_WebEditOR("MasterFile","Reports - Performance","N
ame")
Call pageCheck_WebListOR("MasterFile","Reports - Performance","C
ountryOfManagement;PricingType;Region")
'Step 6,7
Call PerfThresholdPricingSearchCriteria("MasterFile","Reports -
Performance")
Call chkMFReportsPerfThresholdPricingSearchResult("MasterFile","
Reports - Performance")
Call select_Menu("MasterFile","Reports - Performance","Home;DR H
ome")
End Function
Public Function MFReportsPerfThreshold_TC2()
Call MFReportsPerfThreshold_TC1()
End Function
Public Function MFReportsPerfThreshold_TC3()
Call MFReportsPerfThreshold_TC1()
End Function
Public Function MFReportsPerfThreshold_TC4()
Call MFReportsPerfThreshold_TC1()
End Function
Public Function MFReportsPerfThreshold_TC5()
'Step 3
Call click_WebElement("MasterFile","Depositary Receipt Division'
s","MasterFile")
'Step 4,5
Call select_Menu("MasterFile","MasterFile",DataTable.Value("Menu
Path","PerfThresholdPricing"))
Call pageCheck_WebEditOR("MasterFile","Reports - Performance","N
ame")
Call pageCheck_WebListOR("MasterFile","Reports - Performance","C
ountryOfManagement;PricingType;Region")
'Step 6
Call PerfThresholdPricingSearchCriteria("MasterFile","Reports -
Performance")
Call chkMFReportsPerfThresholdPricingSearchResult("MasterFile","
Reports - Performance")
'Step 7
Call FilterCriteria("MasterFile","Reports - Performance","Filter
",DataTable.Value("FilterColumn","PerfThresholdPricing"),DataTable.Value("Filter
Expression","PerfThresholdPricing"),DataTable.Value("FilterValue","PerfThreshold
Pricing"))
Call chkFilterSearchCriteria("MasterFile","Reports - Performance
",DataTable.Value("FilterColumn","PerfThresholdPricing"),DataTable.Value("Filter
Expression","PerfThresholdPricing"),DataTable.Value("FilterValue","PerfThreshold
Pricing"))
Call chkMFReportsPerfThresholdPricingSearchResult("MasterFile","
Reports - Performance")
Call select_Menu("MasterFile","Reports - Performance","Home;DR H
ome")
End Function
Public Function MFReportsPerfThreshold_TC6()
'Step 3
Call click_WebElement("MasterFile","Depositary Receipt Division'
s","MasterFile")
'Step 4,5
Call select_Menu("MasterFile","MasterFile",DataTable.Value("Menu
Path","PerfThresholdPricing"))
Call pageCheck_WebEditOR("MasterFile","Reports - Performance","N
ame")
Call pageCheck_WebListOR("MasterFile","Reports - Performance","C
ountryOfManagement;PricingType;Region")
'Step 6
Call PerfThresholdPricingSearchCriteria("MasterFile","Reports -
Performance")
Call chkMFReportsPerfThresholdPricingSearchResult("MasterFile","
Reports - Performance")
'Step 7
Browser("MasterFile").Page("Reports - Performance").WebElement("
Filter").Click
Call pageCheck_WebList("MasterFile","Reports - Performance","fil
tercolumn;exp;act","Filter:")
Call pageCheck_WebButton("MasterFile","Reports - Performance","A
dd;Delete;OK","Filter:")
Call pageCheck_WebEdit("MasterFile","Reports - Performance","val
ue","Filter:")
'Step 8
Call FilterSort_clkAddDelButton("MasterFile","Reports - Performa
nce","Filter:","Add")
intRowCount = Browser("MasterFile").Page("Reports - Performance"
).WebTable("FilterColumn").RowCount
If Browser("MasterFile").Page("Reports - Performance").WebTable(
"FilterColumn").ChildItem(intRowCount,1,"WebList",0).Exist And Browser("MasterF
ile").Page("Reports - Performance").WebTable("FilterColumn").ChildItem(intRowCou
nt,2,"WebList",0).Exist And Browser("MasterFile").Page("Reports - Performance").
WebTable("FilterColumn").ChildItem(intRowCount,3,"WebEdit",0).Exist And Browser(
"MasterFile").Page("Reports - Performance").WebTable("FilterColumn").ChildItem(i
ntRowCount,4,"WebList",0).Exist Then
Reporter.ReportEvent micPass,"Verification of the presen
ce of Fields in new row in Filter Table After click on Add Button","New row is p
resent with Column,Expression,Value and And/Or list box"
Else
Reporter.ReportEvent micFail,"Verification of the presen
ce of Fields in new row in Filter Table After click on Add Button","New row is N
OT present with Column,Expression,Value and And/Or list box"
'captureScreenshot
Environment.Value("Execution_Log")=False
Environment.Value("TestCase_Log")=False
End If
Call select_Menu("MasterFile","Reports - Performance","Home;DR H
ome")
End Function
Public Function MFReportsPerfThreshold_TC7()
'Step 3
Call click_WebElement("MasterFile","Depositary Receipt Division'
s","MasterFile")
'Step 4,5
Call select_Menu("MasterFile","MasterFile",DataTable.Value("Menu
Path","PerfThresholdPricing"))
Call pageCheck_WebEditOR("MasterFile","Reports - Performance","N
ame")
Call pageCheck_WebListOR("MasterFile","Reports - Performance","C
ountryOfManagement;PricingType;Region")
'Step 6
Call PerfThresholdPricingSearchCriteria("MasterFile","Reports -
Performance")
Call chkMFReportsPerfThresholdPricingSearchResult("MasterFile","
Reports - Performance")
'Step 7
Browser("MasterFile").Page("Reports - Performance").WebElement("
Filter").Click
Call pageCheck_WebList("MasterFile","Reports - Performance","fil
tercolumn;exp;act","Filter:")
Call pageCheck_WebButton("MasterFile","Reports - Performance","A
dd;Delete;OK","Filter:")
Call pageCheck_WebEdit("MasterFile","Reports - Performance","val
ue","Filter:")
'Step 8
Call FilterSort_clkAddDelButton("MasterFile","Reports - Performa
nce","Filter:","Add")
intRowCount = Browser("MasterFile").Page("Reports - Performance"
).WebTable("FilterColumn").RowCount
If Browser("MasterFile").Page("Reports - Performance").WebTable(
"FilterColumn").ChildItem(intRowCount,1,"WebList",0).Exist And Browser("MasterF
ile").Page("Reports - Performance").WebTable("FilterColumn").ChildItem(intRowCou
nt,2,"WebList",0).Exist And Browser("MasterFile").Page("Reports - Performance").
WebTable("FilterColumn").ChildItem(intRowCount,3,"WebEdit",0).Exist And Browser(
"MasterFile").Page("Reports - Performance").WebTable("FilterColumn").ChildItem(i
ntRowCount,4,"WebList",0).Exist Then
Reporter.ReportEvent micPass,"Verification of th
e presence of Fields in new row in Filter Table After click on Add Button","New
row is present with Column,Expression,Value and And/Or list box"
Else
Reporter.ReportEvent micFail,"Verification of th
e presence of Fields in new row in Filter Table After click on Add Button","New
row is NOT present with Column,Expression,Value and And/Or list box"
'captureScreenshot
Environment.Value("Execution_Log")=False
Environment.Value("TestCase_Log")=False
End If
'Step 9
Call FilterSort_clkAddDelButton("MasterFile","Reports - Performa
nce","Filter:","Delete")
If Browser("MasterFile").Page("Reports - Performance").WebTable(
"FilterColumn").RowCount < intRowCount Then
Reporter.ReportEvent micPass,"Verification of th
e presence of new row in Filter Table After click on Delete Button","New row is
deleted"
Else
Reporter.ReportEvent micFail,"Verification of the presen
ce of new row in Filter Table After click on Delete Button","New row is NOT dele
ted"
'captureScreenshot
Environment.Value("Execution_Log")=False
Environment.Value("TestCase_Log")=False
End If
Call select_Menu("MasterFile","Reports - Performance","Home;DR H
ome")
End Function
Public Function MFReportsPerfThreshold_TC8()
'Step 3
Call click_WebElement("MasterFile","Depositary Receipt Division'
s","MasterFile")
'Step 4,5
Call select_Menu("MasterFile","MasterFile",DataTable.Value("Menu
Path","PerfThresholdPricing"))
Call pageCheck_WebEditOR("MasterFile","Reports - Performance","N
ame")
Call pageCheck_WebListOR("MasterFile","Reports - Performance","C
ountryOfManagement;PricingType;Region")
'Step 6
Call PerfThresholdPricingSearchCriteria("MasterFile","Reports -
Performance")
Call chkMFReportsPerfThresholdPricingSearchResult("MasterFile","
Reports - Performance")
'Step 7
Call SortCriteria("MasterFile","Reports - Performance","Sort",Da
taTable.Value("SortColumn","PerfThresholdPricing"),DataTable.Value("SortOrder","
PerfThresholdPricing"))
Call select_Menu("MasterFile","Reports - Performance","Home;DR H
ome")
End Function
Public Function MFReportsPerfThreshold_TC9()
'Step 3
Call click_WebElement("MasterFile","Depositary Receipt Division'
s","MasterFile")
'Step 4,5
Call select_Menu("MasterFile","MasterFile",DataTable.Value("Menu
Path","PerfThresholdPricing"))
Call pageCheck_WebEditOR("MasterFile","Reports - Performance","N
ame")
Call pageCheck_WebListOR("MasterFile","Reports - Performance","C
ountryOfManagement;PricingType;Region")
'Step 6
Call PerfThresholdPricingSearchCriteria("MasterFile","Reports -
Performance")
Call chkMFReportsPerfThresholdPricingSearchResult("MasterFile","
Reports - Performance")
'Step 7
Browser("MasterFile").Page("Reports - Performance").WebElement("
Sort").Click
Call pageCheck_WebList("MasterFile","Reports - Performance","sor
tcolumn;order","Sort:")
Call pageCheck_WebButton("MasterFile","Reports - Performance","A
dd;Delete;OK","Sort:")
'Step 8
Call FilterSort_clkAddDelButton("MasterFile","Reports - Performa
nce","Sort:","Add")
intSortRowCount = Browser("MasterFile").Page("Reports - Performa
nce").WebTable("SortColumn").RowCount
If Browser("MasterFile").Page("Reports - Performance").WebTable(
"SortColumn").ChildItem(intSortRowCount,1,"WebList",0).Exist And Browser("Master
File").Page("Reports - Performance").WebTable("SortColumn").ChildItem(intSortRow
Count,2,"WebList",0).Exist Then
Reporter.ReportEvent micPass,"Verification of th
e presence of Fields in new row in Sort Table After click on Add Button","New ro
w is present with SortColumn and Order list box"
Else
Reporter.ReportEvent micFail,"Verification of th
e presence of Fields in new row in Sort Table After click on Add Button","New ro
w is NOT present with SortColumn and Order list box"
'captureScreenshot
Environment.Value("Execution_Log")=False
Environment.Value("TestCase_Log")=False
End If
Call select_Menu("MasterFile","Reports - Performance","Home;DR H
ome")
End Function
Public Function MFReportsPerfThreshold_TC10()
'Step 3
Call click_WebElement("MasterFile","Depositary Receipt Division'
s","MasterFile")
'Step 4,5
Call select_Menu("MasterFile","MasterFile",DataTable.Value("Menu
Path","PerfThresholdPricing"))
Call pageCheck_WebEditOR("MasterFile","Reports - Performance","N
ame")
Call pageCheck_WebListOR("MasterFile","Reports - Performance","C
ountryOfManagement;PricingType;Region")
'Step 6
Call PerfThresholdPricingSearchCriteria("MasterFile","Reports -
Performance")
Call chkMFReportsPerfThresholdPricingSearchResult("MasterFile","
Reports - Performance")
'Step 7
Browser("MasterFile").Page("Reports - Performance").WebElement("
Sort").Click
Call pageCheck_WebList("MasterFile","Reports - Performance","sor
tcolumn;order","Sort:")
Call pageCheck_WebButton("MasterFile","Reports - Performance","A
dd;Delete;OK","Sort:")
'Step 8
Call FilterSort_clkAddDelButton("MasterFile","Reports - Performa
nce","Sort:","Add")
intSortRowCount = Browser("MasterFile").Page("Reports - Performa
nce").WebTable("SortColumn").RowCount
If Browser("MasterFile").Page("Reports - Performance").WebTable(
"SortColumn").ChildItem(intSortRowCount,1,"WebList",0).Exist And Browser("Master
File").Page("Reports - Performance").WebTable("SortColumn").ChildItem(intSortRow
Count,2,"WebList",0).Exist Then
Reporter.ReportEvent micPass,"Verification of th
e presence of Fields in new row in Sort Table After click on Add Button","New ro
w is present with SortColumn and Order list box"
Else
Reporter.ReportEvent micFail,"Verification of th
e presence of Fields in new row in Sort Table After click on Add Button","New ro
w is NOT present with SortColumn and Order list box"
'captureScreenshot
Environment.Value("Execution_Log")=False
Environment.Value("TestCase_Log")=False
End If
'Step 9
Call FilterSort_clkAddDelButton("MasterFile","Reports - Performa
nce","Sort:","Delete")
If Browser("MasterFile").Page("Reports - Performance").WebTable(
"SortColumn").RowCount < intSortRowCount Then
Reporter.ReportEvent micPass,"Verification of th
e presence of new row in Sort Table After click on Delete Button","New row is de
leted"
Else
Reporter.ReportEvent micFail,"Verification of the presen
ce of new row in Sort Table After click on Delete Button","New row is NOT delete
d"
'captureScreenshot
Environment.Value("Execution_Log")=False
Environment.Value("TestCase_Log")=False
End If
Call select_Menu("MasterFile","Reports - Performance","Home;DR H
ome")
End Function
Public Function MFReportsPerfThreshold_TC11()
'Step 3
Call click_WebElement("MasterFile","Depositary Receipt Division'
s","MasterFile")
'Step 4,5
Call select_Menu("MasterFile","MasterFile",DataTable.Value("Menu
Path","PerfThresholdPricing"))
Call pageCheck_WebEditOR("MasterFile","Reports - Performance","N
ame")
Call pageCheck_WebListOR("MasterFile","Reports - Performance","C
ountryOfManagement;PricingType;Region")
'Step 6
Call PerfThresholdPricingSearchCriteria("MasterFile","Reports -
Performance")
Call chkMFReportsPerfThresholdPricingSearchResult("MasterFile","
Reports - Performance")
'Step 7
Call SaveASExcelwithClick("MasterFile","Reports - Performance","
PerfThresholdPricing","Save")
Call select_Menu("MasterFile","Reports - Performance","Home;DR H
ome")
End Function

You might also like