I am using UFT One 2023.
I am able to capture the Row Count of the Parent (Level 1) rows. However, some of the rows have Child (Level 2) rows and I'm having issues capturing the count of these particular rows.
I keep reading articles about using GetNAProperty (and that seems to be working for many people). However, this method is not available in UFT. The closest method I could find was GetROProperty. However, that doesn't seem to be returning the correct count -- it keeps returning ' 1 '.
Here is my code:
'First I select a row
SwfWindow("Portfolio Rebalancing").SwfTable("grdEAA").SelectRow(0)
'Then I attempt to get the row count of any child bands:
childBandsCount = SwfWindow("Portfolio Rebalancing").SwfTable("grdEAA").GetROProperty("ActiveRow.ChildBands.Count")
(This always returns '1' whether there are child rows or not)
Here is an example of my table. The highlighted BLUE rows are the Parent Rows. As can be seen, in some instances there are child rows associated with the Parent rows and in other cases there is not). I just need to select each Parent Row and then determine and/or get the row count of any potential Child Rows
Hello Jason and thank you for contacting Infragistics. Please try the following as I was able to use this to acquire the row count in a loop that looks at each row's ChildBands row count.
d = SwfWindow("Form1").SwfTable("ultraGrid1").RowCount() Set grid = SwfWindow("Form1").SwfTable("ultraGrid1") For i=0 To d-1 Step 1 childBandsCount = grid.GetNAProperty("Rows["+CSTR(i)+"].ChildBands.Count") MsgBox(childBandsCount) childRowsCount = grid.GetNAProperty("Rows["+CSTR(i)+"].ChildBands[0].Rows.Count") MsgBox(childRowsCount) Next
Thanks for the quick reply. However, I am receiving an "Object doesn't support this property or method" error.
Essentially, the code is as follows:
parentRow = SwfWindow("Portfolio Rebalancing").SwfTable("grdEAA").RowCount SwfWindow("Portfolio Rebalancing").SwfTable("grdEAA").SelectRow(0)childRow = SwfWindow("Portfolio Rebalancing").SwfTable("grdEAA").GetNAProperty("Rows[0].ChildBands.Count")
It's throwing the error on that 3rd line.
Is GetNAProperty a valid method in UFT One 2023? I can't find any info on it.
Note: I've enabled only the .NET and Web add-ins in UFT
By the way, I am able to successfully determine if Child Rows exist with .HasChildren method. I am also able to GetCellData from the Child Rows by hard coding the index of the Child Row: ( SwfWindow("Portfolio Rebalancing").SwfTable("grdEAA").GetCellData("2;0",0).
However, I need to know the count of any Child Rows (if applicable) and this is where I'm falling short...
Hello Jason,
Thank you for your reply. The GetNaProperty method is a means to access our components API and is documented here:
www.infragistics.com/.../accessing-controls-properties
Thanks for taking the time to schedule a meeting. As we discussed once you have the corresponding version of Test Advantage then the GetNaProperties will be available in UFT. Let me know if you have any questions.
I uploaded a sample that I tested with the script I provided. Please let me know if it works or not. All you should need to do is unzip the sample and run the EXE from the bin folder and run my script.
filetransfer.infragistics.com/.../j3n7aamgJ4Hpx5a