Table of Contents

Interface IDevice

A mobile device.

Namespace: HP.LFT.SDK.Mobile
Assembly: HP.LFT.SDK.dll
Syntax
public interface IDevice : ITestObject, ITestObjectDescriber, IDisposable, IEnvironment

Properties

FleetType

The fleetType of the device as defined in OpenText Functional Testing Lab

Declaration
string FleetType { get; }
Property Value
Type Description
string

Id

The ID of the device in OpenText Functional Testing Lab

Declaration
string Id { get; }
Property Value
Type Description
string

Location

The location of the device as defined in OpenText Functional Testing Lab

Declaration
string Location { get; }
Property Value
Type Description
string

Manufacturer

The manufacturer of the device.

Declaration
string Manufacturer { get; }
Property Value
Type Description
string

Model

The model name of the device.

Declaration
string Model { get; }
Property Value
Type Description
string

Name

The name of the device as defined in OpenText Functional Testing Lab

Declaration
string Name { get; }
Property Value
Type Description
string

OSType

The operating system currently running on the device.

Declaration
string OSType { get; }
Property Value
Type Description
string

OSVersion

The operating system version currently running on the device.

Declaration
string OSVersion { get; }
Property Value
Type Description
string

Source

The Source to take the device from. DeviceSource

Declaration
DeviceSource Source { get; }
Property Value
Type Description
DeviceSource

Methods

Back()

Presses the device's Back button. (Android Only)

Declaration
void Back()

CloseViewer()

Closes the RDP window for the device (if open). Calling this method does not release the device if it is locked.

Declaration
void CloseViewer()

GetLogs()

Get device logs collected since the device was locked.

Declaration
string GetLogs()
Returns
Type Description
string

The device logs

GetVitals()

Get an accumulation of the device vitals from the time the device was locked, in one second intervals.

Declaration
string GetVitals()
Returns
Type Description
string

The device vitals

Home()

Presses the device's Home button. (Android Only)

Declaration
void Home()

IsViewerOpen()

Checks if the RDP window for the device is open.

Declaration
bool IsViewerOpen()
Returns
Type Description
bool

Menu()

Presses the device's Menu button. (Android Only)

Declaration
void Menu()

NetworkVirtualizationStart(string)

Starts the Network Virtualization service using the specified network profile.

Declaration
void NetworkVirtualizationStart(string profile)
Parameters
Type Name Description
string profile

The name of the profile containing the conditions that you want to apply to the virtualized network. The profile must be set up on the Network Virtualization product.

NetworkVirtualizationStop()

Stops the Network Virtualization service.

Declaration
void NetworkVirtualizationStop()

OpenViewer()

Opens an RDP window for the device. If a window for the device is already open, another window will not open.

Declaration
void OpenViewer()

Pan(Point, Point)

Performs a Pan gesture on the device with default PanArgs.

Declaration
void Pan(Point start, Point end)
Parameters
Type Name Description
Point start

The Point at which to start the pan gesture.

Point end

The Point at which to end the pan gesture.

Pan(Point, Point, PanArgs)

Performs a Pan gesture on the device.

Declaration
void Pan(Point start, Point end, PanArgs args)
Parameters
Type Name Description
Point start

The Point at which to start the pan gesture.

Point end

The Point at which to end the pan gesture.

PanArgs args

PanArgs arguments that define the behavior of the pan operation.

RecentApps()

Opens the list of recent applications. (Android Only)

Declaration
void RecentApps()

SendKey(Keys)

Simulates pressing a special key in the device keyboard.

Declaration
void SendKey(Keys key)
Parameters
Type Name Description
Keys key

The key to be pressed.

SendKey(Keys, int)

Simulates pressing a special key in the device keyboard, with the option to define the time to keep the key pressed.

Declaration
void SendKey(Keys key, int duration)
Parameters
Type Name Description
Keys key

The key to be pressed.

int duration

The time (in milliseconds) to keep the key pressed. The default is 0 (zero).

SendKey(string)

Simulates pressing a custom device key.

Declaration
void SendKey(string keyID)
Parameters
Type Name Description
string keyID

The ID of the key as defined by the device manufacturer.

SendKey(string, int)

Simulates pressing a custom device key, with the option to define the time to keep the key pressed.

Declaration
void SendKey(string keyID, int duration)
Parameters
Type Name Description
string keyID

The ID of the key as defined by the device manufacturer.

int duration

The time (in milliseconds) to keep the key pressed. The default is 0 (zero).

SendString(string)

Simulates entering text (a string) using the device keyboard.

Declaration
void SendString(string text)
Parameters
Type Name Description
string text

The text to send to the device.

SendString(string, int)

Simulates entering text (a string) using the device keyboard, with the option to send each of the string characters in intervals of n milliseconds.

Declaration
void SendString(string text, int interval)
Parameters
Type Name Description
string text

The text to send to the device.

int interval

The time (in milliseconds) to wait before injecting each subsequent character. The value must be between 200 and 3000, or 0 (default), otherwise an exception is thrown.

SetOrientation(DeviceOrientation)

Sets the device orientation.

Declaration
void SetOrientation(DeviceOrientation orientation)
Parameters
Type Name Description
DeviceOrientation orientation

The DeviceOrientation to set on the device.

Shake()

Performs a Shake gesture on the device. (iOS Only)

Declaration
void Shake()

SimulateGPSRelocate(double, double)

Simulates a change in the device's GPS location. (Android Only)

Declaration
void SimulateGPSRelocate(double latitude, double longitude)
Parameters
Type Name Description
double latitude

The latitude coordinate of the location.

double longitude

The longitude coordinate of the location.

SimulateIncomingCall(string)

Simulates an incoming call.

Declaration
void SimulateIncomingCall(string from)
Parameters
Type Name Description
string from

The caller ID of the incoming call.

SimulateIncomingCall(string, EventResponseArgs)

Simulates an incoming call with an optional simulated user response.

Declaration
void SimulateIncomingCall(string from, EventResponseArgs eventResponseArgs)
Parameters
Type Name Description
string from

The caller ID of the incoming call.

EventResponseArgs eventResponseArgs

The simulated user response (EventResponseArgs) to the incoming call that interrupts the flow of the application.

SimulateIncomingSMS(string, string)

Simulates an incoming SMS.

Declaration
void SimulateIncomingSMS(string from, string text)
Parameters
Type Name Description
string from

The caller ID of the incoming SMS message.

string text

The text of the incoming SMS message.

SimulateIncomingSMS(string, string, EventResponseArgs)

Simulates an incoming SMS with an optional simulated user response.

Declaration
void SimulateIncomingSMS(string from, string text, EventResponseArgs eventResponseArgs)
Parameters
Type Name Description
string from

The caller ID of the incoming SMS message.

string text

The text of the incoming SMS message.

EventResponseArgs eventResponseArgs

The simulated user response (EventResponseArgs) to the incoming SMS that interrupts the flow of the application.

SvStartScenario(string)

Starts a specific service virtualization scenario.

Declaration
void SvStartScenario(string svScenarioId)
Parameters
Type Name Description
string svScenarioId

The ID of the relevant scenario, as returned by SvUploadScenario(string, string)

SvStopScenario(string)

Stops a specific service virtualization scenario.

Declaration
void SvStopScenario(string svScenarioId)
Parameters
Type Name Description
string svScenarioId

The ID of the relevant scenario, as returned by SvUploadScenario(string, string)

SvUploadScenario(string, string)

Uploads scenario definition files to the device and makes them available in the current session.

Declaration
string SvUploadScenario(string svServiceId, string scenarioFilesFolder)
Parameters
Type Name Description
string svServiceId

The ID of the relevant service, as returned by SvUploadService(string)

string scenarioFilesFolder

The full path to the folder that contains the scenario definition files.

Returns
Type Description
string

A string representing the ID of the uploaded scenario.

SvUploadService(string)

Uploads a service definition file to the device and makes it available in the current session.

Declaration
string SvUploadService(string serviceFileContents)
Parameters
Type Name Description
string serviceFileContents

The contents of the service definition text file as a string.

Returns
Type Description
string

A string representing the ID of the uploaded service.

Swipe(SwipeDirection)

Swipes the device in the specified direction starting from the leading edge of the element or device.

Declaration
void Swipe(SwipeDirection direction)
Parameters
Type Name Description
SwipeDirection direction

The SwipeDirection.

Swipe(SwipeDirection, Location)

Swipes the device in the specified direction starting from the specified location.

Declaration
void Swipe(SwipeDirection direction, Location startLocation)
Parameters
Type Name Description
SwipeDirection direction

The SwipeDirection.

Location startLocation

The Location coordinates at which to start the swipe.

Touch(Point)

Touches the device at the specified point. (Android Only)

Declaration
void Touch(Point point)
Parameters
Type Name Description
Point point

The Point to touch.

Touch(int, int)

Touches the device at the specified coordinates. (Android Only)

Declaration
void Touch(int x, int y)
Parameters
Type Name Description
int x

The x coordinate to touch.

int y

The y coordinate to touch.

Unlock()

Unlocks the device in OpenText Functional Testing Lab if the device is not locked by another device object. This method also closes the RDP window.

Declaration
void Unlock()

UploadMedia(VideoData, string)

Upload a video to the device for video simulation. The file is deleted when the device is released.

Declaration
void UploadMedia(VideoData videoData, string mediaID)
Parameters
Type Name Description
VideoData videoData

Video file data. Supported formats: MP4, 3GP (Android only), MKV (Android only), MOV (iOS only), M4V (iOS only).

string mediaID

The unique ID of the uploaded video. The ID is used to start the simulation using IApplication.StartCameraSimulationMode.

UploadMedia(VideoData, string, MediaUploadOptions)

Upload a video to the device for video simulation, with the option to save the file. The file is deleted when the device is released.

Declaration
void UploadMedia(VideoData videoData, string mediaID, MediaUploadOptions options)
Parameters
Type Name Description
VideoData videoData

Video file data. Supported formats: MP4, 3GP (Android only), MKV (Android only), MOV (iOS only), M4V (iOS only).

string mediaID

The unique ID of the uploaded video. The ID is used to start the simulation using IApplication.StartCameraSimulationMode.

MediaUploadOptions options

Upload options.

UploadMedia(Image, string)

Upload an image to the device for camera simulation. The file is deleted when the device is released.

Declaration
void UploadMedia(Image image, string mediaID)
Parameters
Type Name Description
Image image

The image file. Supported formats: JPG, GIF, PNG, BMP, TIF (iOS only).

string mediaID

The unique ID of the uploaded media. The ID is used to start the simulation using IApplication.StartCameraSimulationMode.

UploadMedia(Image, string, MediaUploadOptions)

Upload an image to the device for camera simulation, with the option to save the file. The file is deleted when the device is released.

Declaration
void UploadMedia(Image image, string mediaID, MediaUploadOptions options)
Parameters
Type Name Description
Image image

Image file. Supported formats: JPG, GIF, PNG, BMP, TIF (iOS only).

string mediaID

The unique ID of the uploaded image. The ID is used to start the simulation using IApplication.StartCameraSimulationMode.

MediaUploadOptions options

Upload options.

UploadMedia(string, string)

Upload a media file to the device for camera or video simulation. The files are deleted when the device is released.

Declaration
void UploadMedia(string mediaUrl, string mediaID)
Parameters
Type Name Description
string mediaUrl

The URL, including the extension, of the media file (image or video). Supported formats: JPG, GIF, PNG, BMP, TIF (iOS only), MP4, 3GP (Android only), MKV (Android only), MOV (iOS only), M4V (iOS only).

string mediaID

The unique ID of the uploaded media. The ID is used to start the simulation using IApplication.StartCameraSimulationMode.

UploadMedia(string, string, MediaUploadOptions)

Upload a media file to the device for camera or video simulation, with the option to save the file. The files are deleted when the device is released.

Declaration
void UploadMedia(string mediaUrl, string mediaID, MediaUploadOptions options)
Parameters
Type Name Description
string mediaUrl

The URL, including the extension, of the media file (image or video). Supported formats: JPG, GIF, PNG, BMP, TIF (iOS only), MP4, 3GP (Android only), MKV (Android only), MOV (iOS only), M4V (iOS only).

string mediaID

The unique ID of the uploaded media. The ID is used to start the simulation using IApplication.StartCameraSimulationMode.

MediaUploadOptions options

Upload options.

UploadMedia(Uri, string)

Upload a media file to the device for camera or video simulation. The files are deleted when the device is released.

Declaration
void UploadMedia(Uri mediaUrl, string mediaID)
Parameters
Type Name Description
Uri mediaUrl

The URL, including the extension, of the media file (image or video). Supported formats: JPG, GIF, PNG, BMP, TIF (iOS only), MP4, 3GP (Android only), MKV (Android only), MOV (iOS only), M4V (iOS only).

string mediaID

The unique ID of the uploaded media. The ID is used to start the simulation using IApplication.StartCameraSimulationMode.

UploadMedia(Uri, string, MediaUploadOptions)

Upload a media file to the device for camera or video simulation, with the option to save the file. The files are deleted when the device is released.

Declaration
void UploadMedia(Uri mediaUrl, string mediaID, MediaUploadOptions options)
Parameters
Type Name Description
Uri mediaUrl

The URL, including the extension, of the media file (image or video). Supported formats: JPG, GIF, PNG, BMP, TIF (iOS only), MP4, 3GP (Android only), MKV (Android only), MOV (iOS only), M4V (iOS only).

string mediaID

The unique ID of the uploaded media. The ID is used to start the simulation using IApplication.StartCameraSimulationMode.

MediaUploadOptions options

Upload options.

Extension Methods

TestObjectExtensions.WaitUntilExists<T>(T)
TestObjectExtensions.WaitUntilExists<T>(T, int)
TestObjectExtensions.WaitUntil<T>(T, Func<T, bool>)
TestObjectExtensions.WaitUntil<T>(T, Func<T, bool>, int)