Class MobileApp
- Namespace
- Ranorex
- Assembly
- Ranorex.Plugin.Mobile.dll
A capability that adds additional attributes to elements that represent a mobile application.
public class MobileApp : Adapter, IAdapter
- Inheritance
-
MobileApp
- Implements
- Inherited Members
Constructors
MobileApp()
Creates a new MobileApp adapter instance. This constructor is used internally by the Ranorex Core Framework for performance issues!
protected MobileApp()
MobileApp(Element)
Creates a new MobileApp adapter instance.
public MobileApp(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
DeviceName
The unique name of the device. Use this name in the application 'Start' argument to start applications.
public virtual string DeviceName { get; }
Property Value
DeviceOrientation
The current device orientation.
public virtual DeviceOrientation DeviceOrientation { get; }
Property Value
Name
The short name of the application.
public virtual string Name { get; }
Property Value
OSVersion
Name and version number of the device mobile platform.
public virtual string OSVersion { get; }
Property Value
RequiredCapabilities
Capabilities required by the adapter implementation.
protected override string[] RequiredCapabilities { get; }
Property Value
- string[]
Title
The name of the mobile application.
public virtual string Title { get; }
Property Value
VersionCode
Android app version code / iOS app build version
public virtual string VersionCode { get; }
Property Value
VersionName
Android app version name / iOS app version
public virtual string VersionName { get; }
Property Value
Methods
FromElement(Element)
Converts an Element to an instance of this class.
public static MobileApp FromElement(Element element)
Parameters
elementElementThe element to convert.
Returns
- MobileApp
The MobileApp.
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 MobileApp FromPath(string path)
Parameters
pathstringThe search path.
Returns
- MobileApp
The MobileApp.
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.
SetOrientation(DeviceOrientation)
Sets the device orientation.
public virtual void SetOrientation(DeviceOrientation DeviceOrientation)
Parameters
DeviceOrientationDeviceOrientationThe orientation of the device. Possible values are 'Portrait', 'PortraitUpsideDown', 'LandscapeLeft', 'LandscapeRight', 'FaceUp' and 'FaceDown'.
Exceptions
- ActionFailedException
Thrown if invoking the action failed.
Operators
implicit operator MobileApp(Element)
Implicitly converts an Element to an instance of this class.
public static implicit operator MobileApp(Element element)
Parameters
elementElementThe element to convert.
Returns
- MobileApp
The MobileApp.
Exceptions
- ArgumentNullException
If
elementisnull.- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
implicit operator MobileApp(string)
Implicitly converts a string to an instance of this class by searching the root.
public static implicit operator MobileApp(string path)
Parameters
pathstringThe search path.
Returns
- MobileApp
The MobileApp.
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.