Table of Contents

Class Tree

Namespace
Ranorex
Assembly
Ranorex.Core.dll

Represents a tree control.

public class Tree : Adapter, IAdapter
Inheritance
Tree
Implements
Inherited Members

Constructors

Tree()

Creates a new Tree adapter instance. This constructor is used internally by the Ranorex Core Framework for performance issues!

protected Tree()

Tree(Element)

Creates a new Tree adapter instance.

public Tree(Element element)

Parameters

element Element

The element to create the adapter for.

Exceptions

NullReferenceException

If element is null.

CapabilityNotSupportedException

If the element does not support the capabilities required by this adapter.

Properties

DescendantItems

Gets all tree items contained in this subtree as a list.

public IList<TreeItem> DescendantItems { get; }

Property Value

IList<TreeItem>

The descendant tree items.

this[string]

Gets the TreeItem with the specified item label.

public TreeItem this[string itemLabel] { get; }

Parameters

itemLabel string

Property Value

TreeItem

The list item.

Exceptions

ElementNotFoundException

If no item with that label is found.

Items

Gets the tree items which are immediate children of the tree.

public IList<TreeItem> Items { get; }

Property Value

IList<TreeItem>

The tree items.

RequiredCapabilities

Capabilities required by the adapter implementation.

protected override string[] RequiredCapabilities { get; }

Property Value

string[]

SelectedDescendantItems

Gets all selected tree items contained in this subtree as a list.

public IList<TreeItem> SelectedDescendantItems { get; }

Property Value

IList<TreeItem>

The selected descendant tree items.

SelectedItems

Gets the selected tree items which are immediate children of the tree.

public IList<TreeItem> SelectedItems { get; }

Property Value

IList<TreeItem>

The tree items.

Methods

CollapseAll()

Collapses all nodes in the tree.

public void CollapseAll()

ExpandAll()

Expands all nodes in the tree.

public void ExpandAll()

FromElement(Element)

Converts an Element to an instance of this class.

public static Tree FromElement(Element element)

Parameters

element Element

The element to convert.

Returns

Tree

The Tree.

Exceptions

ArgumentNullException

If element is null.

CapabilityNotSupportedException

If the element does not support the capabilities required by this adapter.

FromPath(string)

Converts a string to an instance of this class by searching the root.

public static Tree FromPath(string path)

Parameters

path string

The search path.

Returns

Tree

The Tree.

Remarks

The DefaultSearchTimeout is used to search for the specified path.

Exceptions

ArgumentNullException

If path is null.

RxPathException

If the specified path is not valid.

ElementNotFoundException

If no element is found.

CapabilityNotSupportedException

If the element does not support the capabilities required by this adapter.

Operators

implicit operator Tree(Element)

Implicitly converts an Element to an instance of this class.

public static implicit operator Tree(Element element)

Parameters

element Element

The element to convert.

Returns

Tree

The Tree.

Exceptions

ArgumentNullException

If element is null.

CapabilityNotSupportedException

If the element does not support the capabilities required by this adapter.

implicit operator Tree(string)

Implicitly converts a string to an instance of this class by searching the root.

public static implicit operator Tree(string path)

Parameters

path string

The search path.

Returns

Tree

The Tree.

Remarks

The DefaultSearchTimeout is used to search for the specified path.

Exceptions

ArgumentNullException

If path is null.

RxPathException

If the specified path is not valid.

ElementNotFoundException

If no element is found.

CapabilityNotSupportedException

If the element does not support the capabilities required by this adapter.