Table of Contents

Interface IDevice

Namespace
HP.LFT.SDK.Mobile
Assembly
HP.LFT.SDK.dll

A mobile device.

public interface IDevice : ITestObject, ITestObjectDescriber, IDisposable, IEnvironment
Inherited Members
Extension Methods

Properties

FleetType

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

string FleetType { get; }

Property Value

string

Id

The ID of the device in OpenText Functional Testing Lab

string Id { get; }

Property Value

string

Location

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

string Location { get; }

Property Value

string

Manufacturer

The manufacturer of the device.

string Manufacturer { get; }

Property Value

string

Model

The model name of the device.

string Model { get; }

Property Value

string

Name

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

string Name { get; }

Property Value

string

OSType

The operating system currently running on the device.

string OSType { get; }

Property Value

string

OSVersion

The operating system version currently running on the device.

string OSVersion { get; }

Property Value

string

Source

The Source to take the device from. DeviceSource

DeviceSource Source { get; }

Property Value

DeviceSource

Methods

Back()

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

void Back()

CloseViewer()

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

void CloseViewer()

GetLogs()

Get device logs collected since the device was locked.

string GetLogs()

Returns

string

The device logs

GetVitals()

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

string GetVitals()

Returns

string

The device vitals

Home()

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

void Home()

IsViewerOpen()

Checks if the RDP window for the device is open.

bool IsViewerOpen()

Returns

bool

Menu()

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

void Menu()

NetworkVirtualizationStart(string)

Starts the Network Virtualization service using the specified network profile.

void NetworkVirtualizationStart(string profile)

Parameters

profile string

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.

void NetworkVirtualizationStop()

OpenViewer()

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

void OpenViewer()

Pan(Point, Point)

Performs a Pan gesture on the device with default PanArgs.

void Pan(Point start, Point end)

Parameters

start Point

The Point at which to start the pan gesture.

end Point

The Point at which to end the pan gesture.

Pan(Point, Point, PanArgs)

Performs a Pan gesture on the device.

void Pan(Point start, Point end, PanArgs args)

Parameters

start Point

The Point at which to start the pan gesture.

end Point

The Point at which to end the pan gesture.

args PanArgs

PanArgs arguments that define the behavior of the pan operation.

RecentApps()

Opens the list of recent applications. (Android Only)

void RecentApps()

SendKey(Keys)

Simulates pressing a special key in the device keyboard.

void SendKey(Keys key)

Parameters

key Keys

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.

void SendKey(Keys key, int duration)

Parameters

key Keys

The key to be pressed.

duration int

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

SendKey(string)

Simulates pressing a custom device key.

void SendKey(string keyID)

Parameters

keyID string

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.

void SendKey(string keyID, int duration)

Parameters

keyID string

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

duration int

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.

void SendString(string text)

Parameters

text string

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.

void SendString(string text, int interval)

Parameters

text string

The text to send to the device.

interval int

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.

void SetOrientation(DeviceOrientation orientation)

Parameters

orientation DeviceOrientation

The DeviceOrientation to set on the device.

Shake()

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

void Shake()

SimulateGPSRelocate(double, double)

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

void SimulateGPSRelocate(double latitude, double longitude)

Parameters

latitude double

The latitude coordinate of the location.

longitude double

The longitude coordinate of the location.

SimulateIncomingCall(string)

Simulates an incoming call.

void SimulateIncomingCall(string from)

Parameters

from string

The caller ID of the incoming call.

SimulateIncomingCall(string, EventResponseArgs)

Simulates an incoming call with an optional simulated user response.

void SimulateIncomingCall(string from, EventResponseArgs eventResponseArgs)

Parameters

from string

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.

void SimulateIncomingSMS(string from, string text)

Parameters

from string

The caller ID of the incoming SMS message.

text string

The text of the incoming SMS message.

SimulateIncomingSMS(string, string, EventResponseArgs)

Simulates an incoming SMS with an optional simulated user response.

void SimulateIncomingSMS(string from, string text, EventResponseArgs eventResponseArgs)

Parameters

from string

The caller ID of the incoming SMS message.

text string

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.

void SvStartScenario(string svScenarioId)

Parameters

svScenarioId string

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

SvStopScenario(string)

Stops a specific service virtualization scenario.

void SvStopScenario(string svScenarioId)

Parameters

svScenarioId string

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.

string SvUploadScenario(string svServiceId, string scenarioFilesFolder)

Parameters

svServiceId string

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

scenarioFilesFolder string

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

Returns

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.

string SvUploadService(string serviceFileContents)

Parameters

serviceFileContents string

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

Returns

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.

void Swipe(SwipeDirection direction)

Parameters

direction SwipeDirection

The SwipeDirection.

Swipe(SwipeDirection, Location)

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

void Swipe(SwipeDirection direction, Location startLocation)

Parameters

direction SwipeDirection

The SwipeDirection.

startLocation Location

The Location coordinates at which to start the swipe.

Touch(Point)

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

void Touch(Point point)

Parameters

point Point

The Point to touch.

Touch(int, int)

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

void Touch(int x, int y)

Parameters

x int

The x coordinate to touch.

y int

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.

void Unlock()

UploadMedia(VideoData, string)

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

void UploadMedia(VideoData videoData, string mediaID)

Parameters

videoData VideoData

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

mediaID string

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.

void UploadMedia(VideoData videoData, string mediaID, MediaUploadOptions options)

Parameters

videoData VideoData

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

mediaID string

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

options MediaUploadOptions

Upload options.

UploadMedia(Image, string)

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

void UploadMedia(Image image, string mediaID)

Parameters

image Image

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

mediaID string

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.

void UploadMedia(Image image, string mediaID, MediaUploadOptions options)

Parameters

image Image

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

mediaID string

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

options MediaUploadOptions

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.

void UploadMedia(string mediaUrl, string mediaID)

Parameters

mediaUrl string

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).

mediaID string

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.

void UploadMedia(string mediaUrl, string mediaID, MediaUploadOptions options)

Parameters

mediaUrl string

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).

mediaID string

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

options MediaUploadOptions

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.

void UploadMedia(Uri mediaUrl, string mediaID)

Parameters

mediaUrl Uri

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).

mediaID string

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.

void UploadMedia(Uri mediaUrl, string mediaID, MediaUploadOptions options)

Parameters

mediaUrl Uri

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).

mediaID string

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

options MediaUploadOptions

Upload options.