Table of Contents

Class Text

Namespace
Ranorex
Assembly
Ranorex.Core.dll

Represents an edit box, a text area, or static text.

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

Constructors

Text()

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

protected Text()

Text(Element)

Creates a new Text adapter instance.

public Text(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

BackgroundColor

The text backgroundcolor.

[OriginalDisplayName("BackgroundColor")]
public virtual string BackgroundColor { get; set; }

Property Value

string

Exceptions

SetAttributeFailedException

Thrown if setting the attribute value failed.

Caption

The caption, if the text is not editable.

public virtual string Caption { get; }

Property Value

string

RequiredCapabilities

Capabilities required by the adapter implementation.

protected override string[] RequiredCapabilities { get; }

Property Value

string[]

SelectionLength

The length of the selected text.

public virtual int SelectionLength { get; }

Property Value

int

SelectionStart

The start index of the selected text.

public virtual int SelectionStart { get; }

Property Value

int

SelectionText

The selected text portion.

public virtual string SelectionText { get; }

Property Value

string

TextColor

The text color.

[OriginalDisplayName("TextColor")]
public virtual string TextColor { get; set; }

Property Value

string

Exceptions

SetAttributeFailedException

Thrown if setting the attribute value failed.

TextValue

The text content.

[OriginalDisplayName("Text")]
public virtual string TextValue { get; set; }

Property Value

string

Exceptions

SetAttributeFailedException

Thrown if setting the attribute value failed.

Methods

FromElement(Element)

Converts an Element to an instance of this class.

public static Text FromElement(Element element)

Parameters

element Element

The element to convert.

Returns

Text

The Text.

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 Text FromPath(string path)

Parameters

path string

The search path.

Returns

Text

The Text.

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.

Select(int, int)

Selects the specified text range.

public virtual void Select(int start, int length)

Parameters

start int

The start index of the range to select.

length int

The length of the range to select.

Exceptions

ActionFailedException

Thrown if invoking the action failed.

Operators

implicit operator Text(Element)

Implicitly converts an Element to an instance of this class.

public static implicit operator Text(Element element)

Parameters

element Element

The element to convert.

Returns

Text

The Text.

Exceptions

ArgumentNullException

If element is null.

CapabilityNotSupportedException

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

implicit operator Text(string)

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

public static implicit operator Text(string path)

Parameters

path string

The search path.

Returns

Text

The Text.

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.