Table of Contents

Class AndroidElement

Namespace
Ranorex
Assembly
Ranorex.Plugin.Mobile.dll

General capability for UI elements of a mobile device.

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

Constructors

AndroidElement()

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

protected AndroidElement()

AndroidElement(Element)

Creates a new AndroidElement adapter instance.

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

ContentDescription

Content description for android controls. (see: http://developer.android.com/training/accessibility/accessible-app.html)

public virtual string ContentDescription { get; }

Property Value

string

RId

An R-ID associated with the element. This ID is generated from pre-compilation information of the application (e.g. from Android layouts or iOS *.xib).

public virtual string RId { get; }

Property Value

string

RequiredCapabilities

Capabilities required by the adapter implementation.

protected override string[] RequiredCapabilities { get; }

Property Value

string[]

ResourceId

The Resource ID associated with the element. This ID is generated from the used resources (e.g. the name of the used image).

public virtual string ResourceId { get; }

Property Value

string

TestId

An Id that is defined by user in ReactNative or Jetpack apps

public virtual string TestId { get; }

Property Value

string

Methods

FromElement(Element)

Converts an Element to an instance of this class.

public static AndroidElement FromElement(Element element)

Parameters

element Element

The element to convert.

Returns

AndroidElement

The AndroidElement.

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

Parameters

path string

The search path.

Returns

AndroidElement

The AndroidElement.

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

Implicitly converts an Element to an instance of this class.

public static implicit operator AndroidElement(Element element)

Parameters

element Element

The element to convert.

Returns

AndroidElement

The AndroidElement.

Exceptions

ArgumentNullException

If element is null.

CapabilityNotSupportedException

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

implicit operator AndroidElement(string)

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

public static implicit operator AndroidElement(string path)

Parameters

path string

The search path.

Returns

AndroidElement

The AndroidElement.

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.