Hi,
I have a test that opens a bunch of grid objects at once. that means there will be more than one grid at a time open but only one grid will be active. All other grids are shown on the tab group. if you want to view some other grid that can be done by selecting that particular tab on tab group. Here the problem is QTP is not recognising every grid as separate grid. the test has to select the tab and then retrieve a cell value from the active grid and then move on to next tab. Every time it moves to next tab, it has to retrieve cell data from the grid which is currently active. here it is able to get the cell value from the very first grid but next time it is not reading from the next successive tab. grid table object remaining same for all the tabs and it is giving me the cell data of the first grid for all successive tabs. I thought I should make QTP to recognise grid with the index property because all open grids have same properties. I set the SwfTable object index to 0 in repository. that did not fix the problem. I tried Visible property in repository assuming one grid is visible at that moment. but this did not help me.
SwfWindow("MainWindow").SwfWindow("ABC").SwfTable("gridMain").GetCellData(CInt(5), "ColumnX")
This is the line of code which is used to read a value of a cell from the grid. This works for first time for the first grid but how to make this work for all successive grids?
I appreciate if some body could help on this issue because this is very much needed for my test execution.
Thanks,
Vidya
Hello Vidya,
Please do not hesitate to ask if you have any further questions.
Hello,
I used child objects of the window that has grid embedded in it and now able to read the cell data of every grid without any issues.
Set gridObj = SwfWindow("Parent").SwfWindow("child1").ChildObjects gridObj(0).GetCellData(CINT(rowNum), "ColumnName")
Here gridObj(0) is the SwfTable object.
I made these lines to execute for every grid when it is active. I got the data from every successive grid.
Thanks for all your help,