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
elementElementThe element to create the adapter for.
Exceptions
- NullReferenceException
If
elementisnull.- 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
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
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
TestId
An Id that is defined by user in ReactNative or Jetpack apps
public virtual string TestId { get; }
Property Value
Methods
FromElement(Element)
Converts an Element to an instance of this class.
public static AndroidElement FromElement(Element element)
Parameters
elementElementThe element to convert.
Returns
- AndroidElement
The AndroidElement.
Exceptions
- ArgumentNullException
If
elementisnull.- 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
pathstringThe search path.
Returns
- AndroidElement
The AndroidElement.
Remarks
The DefaultSearchTimeout is used to search for the specified path.
Exceptions
- ArgumentNullException
If
pathisnull.- RxPathException
If the specified
pathis 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
elementElementThe element to convert.
Returns
- AndroidElement
The AndroidElement.
Exceptions
- ArgumentNullException
If
elementisnull.- 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
pathstringThe search path.
Returns
- AndroidElement
The AndroidElement.
Remarks
The DefaultSearchTimeout is used to search for the specified path.
Exceptions
- ArgumentNullException
If
pathisnull.- RxPathException
If the specified
pathis not valid.- ElementNotFoundException
If no element is found.
- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.