11-05-2009, 11:37 PM
Hi,
In this action first half, I am trying to insert values from global datatable and second half inserting values from local datatable. What I am trying to do is in first iteration, insert first row of global datatable and 1 to 3 rows from local datatable. In second iteration, second row of global and 4 to 6 rows of local datatable and so on.
Now with the below code, I am able to run the first iteration well. In the second iteration, it’s inserting second row of global datatable (like I wanted) but its inserting again the 1 to 3 rows of local datatable not 4 to 6 from local datatable. There is something real small to correct but have no idea what to add or what to change. Please suggest. No syntax error or something just the logical error. I kept the code you need to check in bold.
Please help...Thanks in advance
In this action first half, I am trying to insert values from global datatable and second half inserting values from local datatable. What I am trying to do is in first iteration, insert first row of global datatable and 1 to 3 rows from local datatable. In second iteration, second row of global and 4 to 6 rows of local datatable and so on.
Now with the below code, I am able to run the first iteration well. In the second iteration, it’s inserting second row of global datatable (like I wanted) but its inserting again the 1 to 3 rows of local datatable not 4 to 6 from local datatable. There is something real small to correct but have no idea what to add or what to change. Please suggest. No syntax error or something just the logical error. I kept the code you need to check in bold.
Code:
[b]str_currentIteration = Environment("ActionIteration")[/b]
Browser("Department").Page("Welcome").webedit("USER").Set "user"
Browser("Department").Page("Welcome").WebEdit("PASSWORD").SetSecure "Password"
Browser("Department").Page("Welcome").Image("Login").Click
Browser("Welcome").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
[b]str_currentIteration = Environment("ActionIteration") [/b]
(Note: during the first iteration str_currentiteration is 1 but its not incrementing for 2nd iteration)
[b]str_startIteration =(3*str_currentIteration) -2
str_endIteration = 3*str_currentIteration
For i = str_startIteration To str_endIteration
DataTable.GetSheet("Action1").SetCurrentRow(i)[/b]
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
[b]Next[/b]
Please help...Thanks in advance