Find visible elem. - exclude elem. on an invisible container : Automation API

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

Class library usage, coding and language questions.

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

Postby Patrik » Fri Jan 20, 2012 4: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 69 times
Patrik
 
Posts: 13
Joined: Fri Sep 02, 2011 3:56 pm

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

Postby Support Team » Mon Jan 23, 2012 1: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
User avatar
Support Team
Site Admin
 
Posts: 4842
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

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

Postby Patrik » Thu Jan 26, 2012 4:46 pm

Hello - i have sent the snapshot via Email.
Thanks - and best regards,
Patrik
Patrik
 
Posts: 13
Joined: Fri Sep 02, 2011 3:56 pm


Return to Automation API

Who is online

Users browsing this forum: No registered users and 1 guest