Micro Focus QTP (UFT) Forums
Adding data into rows that add dynamically with setcelldata - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Adding data into rows that add dynamically with setcelldata (/Thread-Adding-data-into-rows-that-add-dynamically-with-setcelldata)



Adding data into rows that add dynamically with setcelldata - azar81 - 09-14-2010

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.


'___________________________________________________________________________________________

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



RE: Adding data into rows that add dynamically with setcelldata - supputuri - 09-15-2010

Hi Azar,

You can use regular expression in the OR to handle these scenarios. And then you can use the iteration loops.

If you can share the images of "object spy" and AUT area, then we could able to provide more information.

Let me know if you nee any more info, or have any queries.


RE: Adding data into rows that add dynamically with setcelldata - azar81 - 09-15-2010

Attached please find the screenshot of OR & the rows of AUT. Please do let me know if anything else is need to resolve this issue.

Thanks in Advance.


RE: Adding data into rows that add dynamically with setcelldata - azar81 - 09-16-2010

Any help on this one is much appreciated. Cannot find anything in any forums. Thanks.


RE: Adding data into rows that add dynamically with setcelldata - vidya2k2 - 04-13-2015

H Azar,

I am also facing the similar issue. Is this resolved ? If so, please let me know the solution. Thanks