Table of Contents

Class ListItem

Namespace
Ranorex
Assembly
Ranorex.Core.dll

Represents an item in a list.

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

Constructors

ListItem()

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

protected ListItem()

ListItem(Element)

Creates a new ListItem adapter instance.

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

Image

The image contained in the item.

public virtual Image Image { get; }

Property Value

Image

Index

The index of the item in the container list.

public virtual int Index { get; }

Property Value

int

RequiredCapabilities

Capabilities required by the adapter implementation.

protected override string[] RequiredCapabilities { get; }

Property Value

string[]

Selected

True if the item is currently selected.

public virtual bool Selected { get; set; }

Property Value

bool

Exceptions

SetAttributeFailedException

Thrown if setting the attribute value failed.

Text

The text of the item.

public virtual string Text { get; }

Property Value

string

Methods

FromElement(Element)

Converts an Element to an instance of this class.

public static ListItem FromElement(Element element)

Parameters

element Element

The element to convert.

Returns

ListItem

The ListItem.

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

Parameters

path string

The search path.

Returns

ListItem

The ListItem.

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()

Selects the item.

public virtual void Select()

Exceptions

ActionFailedException

Thrown if invoking the action failed.

Operators

implicit operator ListItem(Element)

Implicitly converts an Element to an instance of this class.

public static implicit operator ListItem(Element element)

Parameters

element Element

The element to convert.

Returns

ListItem

The ListItem.

Exceptions

ArgumentNullException

If element is null.

CapabilityNotSupportedException

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

implicit operator ListItem(string)

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

public static implicit operator ListItem(string path)

Parameters

path string

The search path.

Returns

ListItem

The ListItem.

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.