Find visible elem. - exclude elem. on an invisible container

Class library usage, coding and language questions.
Patrik
Posts: 17
Joined: Fri Sep 02, 2011 2:56 pm

Find visible elem. - exclude elem. on an invisible container

Post by Patrik » Fri Jan 20, 2012 3:28 pm

I want to find all elements in an window that are currently visible. For example, I can do this with the Method

IList<Element> elements = mainWindow.Find(new RxPath(".//"));

Afterwards i check the visible property (another option would be to use the visible property in the XPath). Anyway... in many cases (especially in Java applications) the elements are within a container. Because the container is not visible, also the elements on it are not visible. But because the element has the property visible=true, i will get the elements as visible elements.

Is there an easy way to get only the "real" visible elements ? So one way would be to go through the hirachy recursive, using the children property and only go into the container when it is visible. But maybe there is an easier (more performant) way ?

Thanks in advance,
Patrik
Attachments
visible.jpg
visible.jpg (21.44 KiB) Viewed 958 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Find visible elem. - exclude elem. on an invisible container

Post by Support Team » Mon Jan 23, 2012 12:10 pm

Hi,

Would it be possible to post us a Ranorex Snapshot for further analyzes?
Creating a Ranorex Snapshot

Thanks in advance.

Regards,
Peter
Ranorex Team
.
Image

Patrik
Posts: 17
Joined: Fri Sep 02, 2011 2:56 pm

Re: Find visible elem. - exclude elem. on an invisible container

Post by Patrik » Thu Jan 26, 2012 3:46 pm

Hello - i have sent the snapshot via Email.
Thanks - and best regards,
Patrik