Ranorex.Tree Question

Class library usage, coding and language questions.
atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

Ranorex.Tree Question

Post by atom » Tue May 17, 2011 12:02 pm

Hiya

The Ranorex.Tree class has a method : TreeItem(string Label)
A few questions about this:

- The Label is applied to what TreeItem property
- Can the Label be a regular expression - to return first matching item, or is it an exact label

A general question is then, how can we export all Ranorex.Tree content to an XDocument, so we can use LINQ on it to find items?

Thanks

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

Re: Ranorex.Tree Question

Post by Support Team » Wed May 18, 2011 1:58 pm

Hi,
atom wrote:The Ranorex.Tree class has a method : TreeItem(string Label)
If you mean the Tree indexer, then the indexer internally just calls the Adapter.FindDescendant method. The "defaultlabel" of a TreeItem is its text and the method does not take regular expressions.

Alternatively, to get a specific set of TreeItems from your tree using regular expressions you can use RanoreXPath with the Find method of Ranorex.Tree.

For more details about using RanoreXPath have a look at following links:
http://www.ranorex.com/support/user-gui ... xpath.html
http://www.ranorex.com/blog/ranorexpath-tips-and-tricks

With the Find method, in your case, you will get a list of TreeItems which you can go through and prepare for your XDocument.

For more details about using XDocument have a look at following link:
http://msdn.microsoft.com/en-us/library ... ument.aspx

Kind regards,
Tobias
Support Team
.
Image