Hello. I'm wondering is there any simple or fast way to get the number of copies of a single element?
Assume the same exact image with the same RanorexPath appears on the window screen 30 times. Is there any way I could do something like:
Variable = GetElementCount(repo.Element);
Does anything like that exist? That will return the count of copies of a single element on the screen?
Is there anywhere where the instance count is stored? Like, does anything exist that is like, repo.ElementInfo.NumberOfInstances?
Or, there must be some kind of indexing, right? Like, repo.Element[1] and repo.Element[2] if there are multiple copies of the same element on the screen at once? Does anybody know how I can access the different indexes and go through them one at a time to validate them all? I'm looking for general advice on how to get the instance count when the same element appears multiple times on the screen. I'd need to know how many times that particular element appears.
Thank you.
Is there a way to test how many copies of an element exist?
Re: Is there a way to test how many copies of an element exist?
Hi,
Sure, there is a way to count the elements with the same xpath. Please follow the steps from this post:
how-to-get-the-total-size-of-the-webele ... tml#p67339
Sure, there is a way to count the elements with the same xpath. Please follow the steps from this post:
how-to-get-the-total-size-of-the-webele ... tml#p67339
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
Re: Is there a way to test how many copies of an element exist?
Thank you very much that worked. In my particular example I had to use JavaElement instead of SpanTag because my elements were JavaElements, but I changed it and it's working now. Thanks.