Table of Contents

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

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

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

string

DeviceOrientation

The current device orientation.

public virtual DeviceOrientation DeviceOrientation { get; }

Property Value

DeviceOrientation

Name

The short name of the application.

public virtual string Name { get; }

Property Value

string

OSVersion

Name and version number of the device mobile platform.

public virtual string OSVersion { get; }

Property Value

string

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

string

VersionCode

Android app version code / iOS app build version

public virtual string VersionCode { get; }

Property Value

string

VersionName

Android app version name / iOS app version

public virtual string VersionName { get; }

Property Value

string

Methods

FromElement(Element)

Converts an Element to an instance of this class.

public static MobileApp FromElement(Element element)

Parameters

element Element

The element to convert.

Returns

MobileApp

The MobileApp.

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

Parameters

path string

The search path.

Returns

MobileApp

The MobileApp.

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.

SetOrientation(DeviceOrientation)

Sets the device orientation.

public virtual void SetOrientation(DeviceOrientation DeviceOrientation)

Parameters

DeviceOrientation DeviceOrientation

The 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

element Element

The element to convert.

Returns

MobileApp

The MobileApp.

Exceptions

ArgumentNullException

If element is null.

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

path string

The search path.

Returns

MobileApp

The MobileApp.

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.