Highlighted
Absent Member.
Absent Member.
204 views

Data Parameterization

Jump to solution
hi,
I have one action split into two. For action1_1, i have a global datatable associated and for action 1_2 there is a local datatable associated. Now when i run the script,during Action 1_1, i want the script to insert row1 of global and during Action 1_2, 1 to 3 rows from local datatable. in the next iteration, row2 of global during action1_1 and 4 to 6 from local datatable.

Can somebody please help me with the code.

Action1_1 code:
Browser("Department of Public Welfare").Page("Welcome to the Pennsylvania").webedit("USER").Set "user"
Browser("Department of Public Welfare").Page("Welcome to the Pennsylvania").WebEdit("PASSWORD").SetSecure "Password"
Browser("Department of Public Welfare").Page("Welcome to the Pennsylvania").Image("Login").Click
Browser("Welcome to Pennsylvania").page("County Home Page").Link("ADMINISTRATION").Click
Browser("Administration").Page("Search Contracts").webradiogroup("Add/Search Contract").Select "Add"
Browser("Administration").Page("Search Contracts").weblist("Contract").Select "Foster Family Contracts"
Browser("Administration").Page("Search Contracts").webbutton("Submit").Click
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").webedit("Residential Certificate Number").Set DataTable("RFCN",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebEdit("Fiscal Year").Set DataTable("Contract_Period",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebEdit("Contract Begin Date").Set DataTable("Contract_Effective",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebEdit("Contract End Date").Set DataTable("Contract_End",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebEdit("Facility Name").Set DataTable("Name_of_Facility",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebEdit("Parent Organization Name").Set DataTable("Name_of_Parent_Organization",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebEdit("Facility Location Address1").Set DataTable("Facility_Loc_Add1",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebEdit("Facility Location Address2").Set DataTable("Facility_Loc_Add2",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebEdit("Facility Location City").Set DataTable("Facility_Loc_City",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").weblist("Facility Location State").Select DataTable("Facility_Loc_State",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebEdit("Facility Location Zip Main").Set DataTable("Facility_Loc_Zip_Main",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebEdit("Facility Location Zip Extn").Set DataTable("Facility_Loc_Zip_Extn",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebCheckBox("Copy Facility Loc to Parent Organization Loc").Click
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebButton("Save").Click

Action 1_2 code:
Browser("Add Foster Family Contract").Page("Add Foster Family Classes").WebCheckBox("Performance Based").Set DataTable("PB", dtLocalSheet)
Browser("Add Foster Family Contract").Page("Add Foster Family Classes").WebEdit("Class").Set DataTable("Class",dtLocalSheet)
Browser("Add Foster Family Contract").Page("Add Foster Family Classes").WebEdit("Total PerDiem Foster Family Class").Set DataTable("TPD_Foster_Family_Class",dtLocalSheet)
Browser("Add Foster Family Contract").Page("Add Foster Family Classes").WebEdit("Administrative cost Total PerDiem").Set DataTable("TPD_Admin_Cost",dtLocalSheet)
Browser("Add Foster Family Contract").Page("Add Foster Family Classes").WebEdit("Title IV-E Allowable Maintenance").Set DataTable("Title_IV_E_Maintenance",dtLocalSheet)
Browser("Add Foster Family Contract").Page("Add Foster Family Classes").WebEdit("Title IV-E Allowable Admin Costs").Set DataTable("Title_IV_E_Administrative",dtLocalSheet)
Browser("Add Foster Family Contract").Page("Add Foster Family Classes").WebButton("Insert").Click
0 Likes
1 Solution

Accepted Solutions
Highlighted
Absent Member.
Absent Member.
Try using below code.

Action1_1 code:
str_currentIteration = Environment("ActionIteration")
DataTable.GetSheet("Global").SetCurrentRow(str_currentIteration)
Browser("Department of Public Welfare").Page("Welcome to the Pennsylvania").webedit("USER").Set "user"
Browser("Department of Public Welfare").Page("Welcome to the Pennsylvania").WebEdit("PASSWORD").SetSecure "Password"
Browser("Department of Public Welfare").Page("Welcome to the Pennsylvania").Image("Login").Click
Browser("Welcome to Pennsylvania").page("County Home Page").Link("ADMINISTRATION").Click
Browser("Administration").Page("Search Contracts").webradiogroup("Add/Search Contract").Select "Add"
Browser("Administration").Page("Search Contracts").weblist("Contract").Select "Foster Family Contracts"
Browser("Administration").Page("Search Contracts").webbutton("Submit").Click
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").webedit("Residential Certificate Number").Set DataTable("RFCN",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebEdit("Fiscal Year").Set DataTable("Contract_Period",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebEdit("Contract Begin Date").Set DataTable("Contract_Effective",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebEdit("Contract End Date").Set DataTable("Contract_End",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebEdit("Facility Name").Set DataTable("Name_of_Facility",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebEdit("Parent Organization Name").Set DataTable("Name_of_Parent_Organization",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebEdit("Facility Location Address1").Set DataTable("Facility_Loc_Add1",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebEdit("Facility Location Address2").Set DataTable("Facility_Loc_Add2",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebEdit("Facility Location City").Set DataTable("Facility_Loc_City",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").weblist("Facility Location State").Select DataTable("Facility_Loc_State",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebEdit("Facility Location Zip Main").Set DataTable("Facility_Loc_Zip_Main",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebEdit("Facility Location Zip Extn").Set DataTable("Facility_Loc_Zip_Extn",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebCheckBox("Copy Facility Loc to Parent Organization Loc").Click
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebButton("Save").Click

Action 1_2 code:
str_currentIteration = Environment("ActionIteration")
str_startIteration = (3*str_currentIteration - 2)
str_endIteration = 3*str_currentIteration
For i = str_startIteration To str_endIteration
DataTable.GetSheet("dtLocalSheet").SetCurrentRow(i)
Browser("Add Foster Family Contract").Page("Add Foster Family Classes").WebCheckBox("Performance Based").Set DataTable("PB", dtLocalSheet)
Browser("Add Foster Family Contract").Page("Add Foster Family Classes").WebEdit("Class").Set DataTable("Class",dtLocalSheet)
Browser("Add Foster Family Contract").Page("Add Foster Family Classes").WebEdit("Total PerDiem Foster Family Class").Set DataTable("TPD_Foster_Family_Class",dtLocalSheet)
Browser("Add Foster Family Contract").Page("Add Foster Family Classes").WebEdit("Administrative cost Total PerDiem").Set DataTable("TPD_Admin_Cost",dtLocalSheet)
Browser("Add Foster Family Contract").Page("Add Foster Family Classes").WebEdit("Title IV-E Allowable Maintenance").Set DataTable("Title_IV_E_Maintenance",dtLocalSheet)
Browser("Add Foster Family Contract").Page("Add Foster Family Classes").WebEdit("Title IV-E Allowable Admin Costs").Set DataTable("Title_IV_E_Administrative",dtLocalSheet)
Next
Browser("Add Foster Family Contract").Page("Add Foster Family Classes").WebButton("Insert").Click

View solution in original post

0 Likes
4 Replies
Highlighted
Absent Member.
Absent Member.
Try using below code.

Action1_1 code:
str_currentIteration = Environment("ActionIteration")
DataTable.GetSheet("Global").SetCurrentRow(str_currentIteration)
Browser("Department of Public Welfare").Page("Welcome to the Pennsylvania").webedit("USER").Set "user"
Browser("Department of Public Welfare").Page("Welcome to the Pennsylvania").WebEdit("PASSWORD").SetSecure "Password"
Browser("Department of Public Welfare").Page("Welcome to the Pennsylvania").Image("Login").Click
Browser("Welcome to Pennsylvania").page("County Home Page").Link("ADMINISTRATION").Click
Browser("Administration").Page("Search Contracts").webradiogroup("Add/Search Contract").Select "Add"
Browser("Administration").Page("Search Contracts").weblist("Contract").Select "Foster Family Contracts"
Browser("Administration").Page("Search Contracts").webbutton("Submit").Click
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").webedit("Residential Certificate Number").Set DataTable("RFCN",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebEdit("Fiscal Year").Set DataTable("Contract_Period",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebEdit("Contract Begin Date").Set DataTable("Contract_Effective",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebEdit("Contract End Date").Set DataTable("Contract_End",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebEdit("Facility Name").Set DataTable("Name_of_Facility",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebEdit("Parent Organization Name").Set DataTable("Name_of_Parent_Organization",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebEdit("Facility Location Address1").Set DataTable("Facility_Loc_Add1",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebEdit("Facility Location Address2").Set DataTable("Facility_Loc_Add2",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebEdit("Facility Location City").Set DataTable("Facility_Loc_City",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").weblist("Facility Location State").Select DataTable("Facility_Loc_State",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebEdit("Facility Location Zip Main").Set DataTable("Facility_Loc_Zip_Main",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebEdit("Facility Location Zip Extn").Set DataTable("Facility_Loc_Zip_Extn",dtGlobalSheet)
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebCheckBox("Copy Facility Loc to Parent Organization Loc").Click
Browser("Foster Family/Institutional Contract Header").Page("Add Foster Family/Institutional Contract Header").WebButton("Save").Click

Action 1_2 code:
str_currentIteration = Environment("ActionIteration")
str_startIteration = (3*str_currentIteration - 2)
str_endIteration = 3*str_currentIteration
For i = str_startIteration To str_endIteration
DataTable.GetSheet("dtLocalSheet").SetCurrentRow(i)
Browser("Add Foster Family Contract").Page("Add Foster Family Classes").WebCheckBox("Performance Based").Set DataTable("PB", dtLocalSheet)
Browser("Add Foster Family Contract").Page("Add Foster Family Classes").WebEdit("Class").Set DataTable("Class",dtLocalSheet)
Browser("Add Foster Family Contract").Page("Add Foster Family Classes").WebEdit("Total PerDiem Foster Family Class").Set DataTable("TPD_Foster_Family_Class",dtLocalSheet)
Browser("Add Foster Family Contract").Page("Add Foster Family Classes").WebEdit("Administrative cost Total PerDiem").Set DataTable("TPD_Admin_Cost",dtLocalSheet)
Browser("Add Foster Family Contract").Page("Add Foster Family Classes").WebEdit("Title IV-E Allowable Maintenance").Set DataTable("Title_IV_E_Maintenance",dtLocalSheet)
Browser("Add Foster Family Contract").Page("Add Foster Family Classes").WebEdit("Title IV-E Allowable Admin Costs").Set DataTable("Title_IV_E_Administrative",dtLocalSheet)
Next
Browser("Add Foster Family Contract").Page("Add Foster Family Classes").WebButton("Insert").Click

View solution in original post

0 Likes
Highlighted
Absent Member.
Absent Member.
The above code worked for one iteration. But for the second iteration, It is again taking the first row from the global during action1_1. its not going to the second row of global.Please suggest.

Thank you
0 Likes
Highlighted
Absent Member.
Absent Member.
Arpan,

'DataTable.GetSheet("Global").SetCurrentRow(str_currentIteration)

When i removed the above line from the code you posted of Action1_1 and ran the script, first iteration was just like i wanted, in the second iteration, It inserted the second row of the global like i wanted but when it comes to action1_2, It is again inserting first 3 rows of local datatable. Its not going to row4 and not inserting row4 to 6 according to the script. Please correct me If i have to add something else to the script.

Thank you
0 Likes
Highlighted
Absent Member.
Absent Member.
Below code resolved my issue:

GlobalRowCount=datatable.GetSheet("Global").GetRowCount
ActionRowCount=datatable.GetSheet("Action1").GetRowCount
Str_currentIteration=1
For i=1 to GlobalRowCount step 1
msgbox "Str_currentIteration value" &Str_currentIteration
DataTable.GetSheet("Global").SetCurrentRow(i)
globaltablevalue=datatable.Value(1,1)
msgbox globaltablevalue
For j=Str_currentIteration to Str_currentIteration+2 step 1
DataTable.GetSheet("Action1").SetCurrentRow(j)
actiontablevalue=datatable.Value(1,2)
msgbox actiontablevalue
Next
Str_currentIteration=Str_currentIteration+3
Next
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.