There are a million posts about this. I've read them all and still need help. To me this: repository.FrmMain.dgvIntervals.Rows.Count where dgvIntervals is a table makes all the sense in the world but I always get 0. I made a variable for my rows and indexed through them while counting, but it's very slow and I need to do this multiple times. I also tried:
IEnumerable<Ranorex.Row> rowList = repository.PART_GridViewVirtualizingPanel.Find<Ranorex.Row>(./Row)
Dim includedCount As Integer = rowList.Count
but I can't find much reference online to the things it uses so I dont understand why it breaks. Any help is welcome thanks!
Counting rows in a table
Counting rows in a table
You do not have the required permissions to view the files attached to this post.
Re: Counting rows in a table
Hi,
The problem is, that the table in your snapshot does not act as standard table, with rows and columns The 'rows' are actually stored in 'Container' element... The table appears to be WPF-based, so I would suggest to try different WPF plugin settings. This may help with correct table appearance. Otherwise, you must utilize different approach.
For example, this xpath returns all table 'rows', stored as containers (except 'header' container):
Now you can use this code, which should return count of row-containers. The repoElement parameter should be filled with repository element, with above xpath:
The problem is, that the table in your snapshot does not act as standard table, with rows and columns The 'rows' are actually stored in 'Container' element... The table appears to be WPF-based, so I would suggest to try different WPF plugin settings. This may help with correct table appearance. Otherwise, you must utilize different approach.
For example, this xpath returns all table 'rows', stored as containers (except 'header' container):
Code: Select all
/form[@automationid='BuilderWindow']//table[@automationid='sfDataGridIncluded']/container[@automationid='PART_VisualContainer']/container[@type!='DepoGroup<HeaderRowControl>']
Code: Select all
public static void ContainersCount(RepoItemInfo repoElement)
{
IList<Ranorex.Container> containerList = repoElement.CreateAdapters<Ranorex.Container>();
int containerCount = containerList.Count;
}
You do not have the required permissions to view the files attached to this post.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration