TreeNode Issue

Ranorex Spy, Recorder, and Studio.
Rakesh123
Posts: 63
Joined: Thu Oct 28, 2010 2:18 pm

TreeNode Issue

Post by Rakesh123 » Fri Feb 01, 2013 10:40 am

Hi,

I am trying to automate an application using Ranorex.

I am facing a small problem when I am working with Tree Object.

Here is the scenario...

A tree is looks like below..

ParentNode1
--ChildNode1
---SubChildNode 1
---SubChildNode 2
|
|
|
---SubChildNode n
|
|
|
|
|
ParentNode N
--ChildNode N
---SubChildNode 1
--C1
--C2
|
|
|
--Cn


I want to write a generic function for this so that how many child node I pass as parameter it should select that particular node

E.g: If I want to select 'C1' under 'SubChildNode 1' then I can able to select that node & in second case if I want to select want to select 'SubChildNode 1' under 'ChildNode1' under 'ParentNode1' I can able to select that also.

If we look both 'ParentNode1' & 'ParentNode N' levels count are different.

'ParentNode1' has 3 levels whereas 'ParentNode N' has 4 levels.

Pls repond me ASAP as we have an urgent requirement regading this.

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

Re: TreeNode Issue

Post by Support Team » Mon Feb 04, 2013 4:26 pm

Hello,

I am afraid that I didn't quite catch that.
Why don't you use the RxPath to recognize the elements?
If you want to get all child nodes from a specific tree node you can use the method DescendatItems for example.
IList<TreeItem> treeList = ParentTreeNode.DescendantItems;
Please explain if I understood something wrong.

Kind regards,
Bernhard
.
Image