09-14-2010, 11:20 PM
I have an issue adding data into rows that add dynamically in wbfgrid
Here is the scenario,
Add data into 1st row(webtable) and click.
Add data into 2nd row (now it automatically turns to wbfgrid) - these rows are dynamically added if we have data
to be entered.
Add data into 3rd row (now it automatically turns to wbfgrid)
If I use For or Do loop, it will iterate and add data into the first row itself. And will not enter data into the
2nd row and 3rd & so on....
Please help me on this on how to enter data in different rows using For or Do Loop.
Here is the code.
'___________________________________________________________________________________________
Here is the scenario,
Add data into 1st row(webtable) and click.
Add data into 2nd row (now it automatically turns to wbfgrid) - these rows are dynamically added if we have data
to be entered.
Add data into 3rd row (now it automatically turns to wbfgrid)
If I use For or Do loop, it will iterate and add data into the first row itself. And will not enter data into the
2nd row and 3rd & so on....
Please help me on this on how to enter data in different rows using For or Do Loop.
Here is the code.
'___________________________________________________________________________________________
Code:
Set Fr1 = Browser("Browser").Page("Page").Frame("Frame_3")
'1sr row (exist by default)- webtable
Fr1.WebEdit("dgService:_ctl2:txtdosfrom").Set "07/15/10"
Fr1.WebButton("Button").Click
Fr1.WebEdit("dgService:_ctl2:txtdosto").Set "07/15/10"
Fr1.WebButton("Button").Click
Fr1.WebEdit("dgService:_ctl2:txtlocation").Set "11"
Fr1.WebButton("Button").Click
Fr1.WebEdit("dgService:_ctl2:txtservcode").Set "11301"
Fr1.WebButton("Button").Click
Fr1.WebButton("Button").Click
Fr1.WebEdit("dgService:_ctl2:txtFee").Set "110.00"
Fr1.WebButton("Button").Click
Fr1.WebEdit("dgService:_ctl2:txtBilledUnits").Set "1"
Fr1.WebButton("Button").Click
Fr1.WebButton("Button").Click
Fr1.WebEdit("dgService:_ctl2:txtDiagnosis").Set "1"
Fr1.WebButton("Button").Click
Fr1.WebEdit("dgService:_ctl2:txtStatus").Set "OKAY"
Fr1.WebEdit("dgService:_ctl2:txtStatus").Submit
'2nd row - row is added dynamically upon click or enter - changes from webtable to wbfgrid
Fr1.WbfGrid("dgService_DT_1283368952689").SetCellData 2,3,"07/15/10"
Fr1.WebButton("Button").Click
Fr1.WebButton("Button").Click
Fr1.WbfGrid("dgService_DT_1283368952689").SetCellData 2,4,"07/15/10"
Fr1.WebButton("Button").Click
Fr1.WbfGrid("dgService_DT_1283368952689").SetCellData 2,5,"11"
Fr1.WebButton("Button").Click
Fr1.WbfGrid("dgService_DT_1283368952689").SetCellData 2,6,"11300"
Fr1.WebButton("Button").Click
Fr1.WbfGrid("dgService_DT_1283368952689").SetCellData 2,8,"51"
Fr1.WebButton("Button").Click
Fr1.WbfGrid("dgService_DT_1283368952689").SetCellData 2,9,"80.00"
Fr1.WebButton("Button").Click
Fr1.WbfGrid("dgService_DT_1283368952689").SetCellData 2,10,"1"
Fr1.WebButton("Button").Click
Fr1.WebButton("Button").Click
Fr1.WbfGrid("dgService_DT_1283368952689").SetCellData 2,22,"1"
Fr1.WebButton("Button").Click
Fr1.WebButton("Button").Click
Fr1.WbfGrid("dgService_DT_1283368952689").Submit
Fr1.WebButton("Button").Click
'3rd row - row is added dynamically upon click or enter
Fr1.WbfGrid("dgService_DT_1283368993752").SetCellData 3,3,"07/15/10"
Fr1.WebButton("Button").Click
Fr1.WbfGrid("dgService_DT_1283368993752").SetCellData 3,4,"07/15/10"
Fr1.WebButton("Button").Click
Fr1.WbfGrid("dgService_DT_1283368993752").SetCellData 3,5,"11"
Fr1.WebButton("Button").Click
Fr1.WbfGrid("dgService_DT_1283368993752").SetCellData 3,6,"11300"
Fr1.WebButton("Button").Click
Fr1.WbfGrid("dgService_DT_1283368993752").SetCellData 3,8,"51"
Fr1.WebButton("Button").Click
Fr1.WbfGrid("dgService_DT_1283368993752").SetCellData 3,9,"80.00"
Fr1.WebButton("Button").Click
Fr1.WbfGrid("dgService_DT_1283368993752").SetCellData 3,10,"1"
Fr1.WebButton("Button").Click
Fr1.WbfGrid("dgService_DT_1283368993752").SetCellData 3,22,"1"
Fr1.WebButton("Button").Click
Fr1.WbfGrid("dgService_DT_1283368993752").Submit