Legacy | UFT Function Reference: Device
Perfecto Lab Device class; part of the UFT Mobile (QTP) integration.
Incorporates a Perfecto Lab device into the existing UFT structure, with designated object properties and methods.
Properties
The built-in Device properties that can be retrieved from the Device object include:
(Also see the Device info function.)
- device_id
- status
- rotation
- resolution_width
- resolution_height
- resolution
- position
- phone_number
- os_version
- os
- network
- model
- manufacturer
- location
- last_timer_ux
- last_timer_system
- last_timer_device
- last_timer_elapsed
- language
- in_use
- imsi
- firmware
- distributer
- description
- cradle_id
Use the GetROProperty UFT method to retrieve the current value of a specified identification property from the Device object.
Functions
Name | Description |
---|---|
Close | Close the device. |
Drag | Perform a drag gesture on the device screen. |
Home | Bring the device to its idle/home screen. |
KeyboardDisplay | Control the virtual keyboard display. |
Open | Open the device. |
PressKey | Press a key or a sequence of keys. |
Reboot | Reboot the device. |
Roll | Roll the trackball across the target device screen. |
PressKey | Press a key or a sequence of keys. |
Screenshot | Capture an image of the current screen display, in JPEG format, and store it in the media repository. |
ScreenText | Retrieve the text that appears on the device screen. |
Swipe | Perform a swipe gesture on the device screen. |
Touch | Perform a touch gesture on the device screen. |
Type | Type text into the device. |
Applications | Applications functions. |
Checkpoints | Checkpoints functions. |
Files | Files functions. |
Resources | Resources functions. |
UserFunctions | UserFunctions functions. |
WebBrowser | WebBrowser functions. |
MButton | A button object identified on the device screen based on an image or text label. It can be found and clicked on. |
MEdit | A text object identified on the device screen based on an image or text label. It can be found, retrieved, and set to the specified text. |
MObject | An image or text object (the needle) that can be found and clicked on the device screen (the haystack). |
GetROProperty | Return the current value of the specified identification property dialog box the object in the application. |
Additional UFT functions |
|
Example
UFT Mobile Code Syntax | Description |
---|---|
Device("DUT").Home | On the device under test (DUT), brings the device under test to its home screen. |
Device("DUT").GetROProperty("manufacturer") | On the DUT, retrieves the manufacturer property of the device under test (DUT) object. |
Device("DUT").MEdit("image").GetROProperty("text") | On the DUT, retrieves the text property from the MEdit object – using the Edit Get (image) function. |