FindChildren method

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
joebartt
Posts: 14
Joined: Wed Oct 05, 2016 12:45 pm

FindChildren method

Post by joebartt » Thu Apr 20, 2017 3:21 pm

I am using the FindChildren method to return the contents of a datagrid (datapresenter). When applying filters to the grid, the FindChildren method still returns the same contents. I'm assuming this is because the filter is simply hiding from view the contents that don't apply. Is there a way to use the FindChildren method to return only the visible contents of a datagrid (datapresenter)? Or is there another method used for this?

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: FindChildren method

Post by odklizec » Thu Apr 20, 2017 3:29 pm

Hi,

Please upload a Ranorex snapshot of the datagrid in question and xpath you are using. Without these, it's pretty hard to suggest something reliable.

Basically, I would suggest to add @visible='true' attribute to the searched xpath. But without seeing the datagrid snapshot (preferable both with and without filtered data), it's impossible to tell if it will work or not.
Pavel Kudrys
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

joebartt
Posts: 14
Joined: Wed Oct 05, 2016 12:45 pm

Re: FindChildren method

Post by joebartt » Thu Apr 20, 2017 4:26 pm

submitted via email.

I stumbled across this, but it says obsolete and not sure if it works anymore:

http://www.ranorex.com/Documentation/Ra ... n__1_1.htm

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: FindChildren method

Post by krstcs » Thu Apr 20, 2017 5:05 pm

Yeah, Find<>() is the appropriate method for this type of thing. FindChildren(), etc. are all deprecated and should not be used.

Find() uses the calling repo item's base path as the search point, appending the given path value and searching until the timeout. It will return a collection of all elements that it found within the timeout that match the XPath.
Shortcuts usually aren't...

joebartt
Posts: 14
Joined: Wed Oct 05, 2016 12:45 pm

Re: FindChildren method

Post by joebartt » Thu Apr 20, 2017 5:36 pm

FYI I think I have figured out a solution.

I switched from FindChildren method to Find method, passing in the Xpath with @visible='True' attribute and it seems to be working.