Page 1 of 1

Ranorex.Tree Question

Posted: Tue May 17, 2011 12:02 pm
by atom
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

Re: Ranorex.Tree Question

Posted: Wed May 18, 2011 1:58 pm
by Support Team
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