Forum Discussion

mkruszynski's avatar
mkruszynski
Occasional Contributor
10 years ago
Solved

Data loop into dynamic grid

I am very new to TestComplete and am trying to find the most efficient way to cycle through entering data.  I have a dynamic grid that creates rows as needed.  I am trying to execute a data loop on the grid to create data in multiple rows.  I have no problem setting up the data loop but the issue I am running into is that I only have 1 data grid row mapped and when the dataloop cycles to the next row it is not able to locate the controls in the 2nd row because the control is still looking at row 1 instead of cycling on to row 2.  Is there a recommended mapping for dynamic grids so that it can cycle through the rows successfully?  Thanks.
  • Hi,'

    Yes if you are to map data rows it self, could be problem since you can not map each and every row. How about mapping the grid?



    What I do is just map the grid and when ever I need the last row I use "Grid.wRowcount" method. Say for eg I have 3 rows and need to enter 4th , i get TC to double click the row number (Grid.wRowcount) so I have new row.



    And could enter something like Grid.ClickCell(Row, "Column Name", 0)....and Grid.Cell.Keys("my value")



    How you can do and exact method will depend on your applcation under test, but I hope you can use the concept.

1 Reply

  • NisHera's avatar
    NisHera
    Valued Contributor
    Hi,'

    Yes if you are to map data rows it self, could be problem since you can not map each and every row. How about mapping the grid?



    What I do is just map the grid and when ever I need the last row I use "Grid.wRowcount" method. Say for eg I have 3 rows and need to enter 4th , i get TC to double click the row number (Grid.wRowcount) so I have new row.



    And could enter something like Grid.ClickCell(Row, "Column Name", 0)....and Grid.Cell.Keys("my value")



    How you can do and exact method will depend on your applcation under test, but I hope you can use the concept.