Ranorex.Tree Question : Automation API

Ranorex.Tree Question

Class library usage, coding and language questions.

Ranorex.Tree Question

Postby atom » Tue May 17, 2011 1: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
atom
 
Posts: 339
Joined: Mon Dec 08, 2008 12:14 am
Location: Dublin, Ireland

Re: Ranorex.Tree Question

Postby Support Team » Wed May 18, 2011 2: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
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests