Micro Focus QTP (UFT) Forums
FlexDataGrid rows - 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: FlexDataGrid rows (/Thread-FlexDataGrid-rows)



FlexDataGrid rows - pranjal - 08-30-2009

Hi,
I have a FlexDataGrid which has 20 rows. Only 17 are visible without scrolling.
I get the number of rows in a FlexDataGrid using .GetROProperty("rowcount")
But this only gives me the number of rows that are visible on the screen without scrolling.
How can I get all the rows in the grid?
Please let me know.
Thank you.


RE: FlexDataGrid rows - Malini - 08-30-2009

Hi,
Instead of using the getRoProperty can you please use the childobjects and try to obtain number of childobjects in the grid?
Code:
Set DescObj=Descp.Create()
DescObj("micclass").value="your flexdatagrid property here"
Set totalrows=Browser(x).Page(x).childObjects(DescObj)
msgbox totalrows.count
Could you please provide the hierarchy so we can implement the code exactly.
Thanks,
Malini

Thanks,
Malini


RE: FlexDataGrid rows - Saket - 08-30-2009

Hi Pranjal,
it will help, If you can specify exactly what you would like to access rows of datagrid.
You can try .SelectIndex(i) to select the row. this should work for rows that are not visible.
And .getROProperty("selectedItem") should get you the item.


RE: FlexDataGrid rows - pranjal - 08-30-2009

Saket, I only need the total number of rows, not the content.
There are 20 rows out of which 1-17 are visible on first load and the FlexDataGrid can be scrolled to the bottom to see 4-20.
The problem is "rowcount" property gives me only 17 instead of 20.

I will try Malini's suggestion and let you know if that worked. Thanks a lot!


RE: FlexDataGrid rows - pranjal - 08-31-2009

I did not get the expected result even after using numautomationchildren. I also tried recording the scroll and getting the number of rows. But it still gives me less number of rows than there are actually in the grid. Here is the code:

Code:
with Browser("browser").FlexApplication("portal").FlexContainer("container").FlexBox("box").FlexBox("innerbox").FlexDataGrid("grid")

Dim rows, totalrows
rows = .GetROProperty("rowcount")
totalrows = .GetROProperty("NumAutomationChildren")

.Scroll 16,flexScrollVertical,flexThumbPosition
rows = .GetROProperty("rowcount")
totalrows = .GetROProperty("NumAutomationChildren")

End With



RE: FlexDataGrid rows - Malini - 08-31-2009

Hi Pranjal,
QTP has the automatic scrolling actually.
Could you please try to obtain the total number of objects in the table by extracting the childobjects..

Thanks,
Malini


RE: FlexDataGrid rows - Saket - 08-31-2009

@Everyone - Please wrap up your code using tags to make it more readable. read this to enhance your posts.


RE: FlexDataGrid rows - basanth27 - 08-31-2009

Is this Supported ?
Code:
.FlexDataGrid().Object.Rows.Count ?
What does this retrieve ? If this does not help see if the DOM method helps you.