Unable to identify the grand child

Ask general questions here.
faheem412
Posts: 13
Joined: Tue Oct 10, 2017 8:52 am

Unable to identify the grand child

Post by faheem412 » Tue Oct 10, 2017 9:13 am

Hi All,

I am new to Ranorex and facing issues to identify the objects. I couldn't find the grand child object. I have used FindChildren, but I am not getting.
Hierarchy is a-b-c-d-e, where a is the parent and e the object i need to identify.
Could you please help me to solve this?

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

Re: Unable to identify the grand child

Post by krstcs » Tue Oct 10, 2017 5:59 pm

Ranorex team, please move this to the appropriate forum area.

faheem412, this area is for posting job openings or personal work availability for Ranorex specific positions.

Please read the user guide: https://www.ranorex.com/help/latest

This is the first step to understanding how Ranorex works, and it will help answer most of the questions you will have starting out.

If your questions aren't answered there, please come back and ask specific questions with lots of background information so we can help. In addition, please always include the following:

FULL Ranorex version (currently 7.1.2 and 7.2.0 are supported) - Should be in the "<MAJ_VER>.<MIN_VER>.<BUG_VER>" format.
Windows version
Technology of system under test (.NET, WPF, Win32, Java, Web, etc.)
Ranorex Snapshot (NOT screenshot) of the element in question (This is very important!)
Shortcuts usually aren't...

User avatar
Vega
Posts: 109
Joined: Mon Jul 11, 2016 2:15 pm

Re: Unable to identify the grand child

Post by Vega » Tue Oct 10, 2017 6:01 pm

It will be hard to provide a solution without seeing a Ranorex snapshot, so if you can please provide one:
https://www.ranorex.com/help/latest/how ... x-snapshot

You should be able to find object 'e' using a relative path from the parent object 'a'. Once again this will be difficult to explain without seeing a Ranorex snapshot but I'll try:

Structure:

-A (Parent [label type])
--B
---C
----D
-----E (desired object [buttontype])

So let's say the path for my parent object 'A' is /form[@title='Example']/?/?/label

I could do something like /form[@title='Example']/?/?/label/?/?/?/button
So here I am using the 'any optional' (/?) operator to skip B / C / D. I would not consider this optimal but it should work; once again depending on your application structure. There are of course many other ways you can do this depending on your application structure as Ranorex path is pretty powerful and flexible. Once again if you're able to provide a Ranorex snapshot it would help a lot!

RanorexPath Tips and tricks:
https://www.ranorex.com/blog/ranorexpat ... nd-tricks/

Ranorex Path general:
https://www.ranorex.com/help/latest/ranorexpath