Share this page

com.hp.lft.sdk.mobile

## Class MobileLab

- java.lang.Object
- - com.hp.lft.sdk.mobile.MobileLab

-     public class MobileLab
      extends java.lang.Object

  The UFT Mobile lab, where users, applications, and devices are managed.

- - ### Constructor Summary

    Constructor and Description
    `MobileLab()`

  - ### Method Summary

    Modifier and Type | Method and Description
    --- | ---
    `static DeviceInfo[]` | `getDeviceList()` Returns a list of DeviceInfo for all devices in UFT Mobile.
    `static java.net.URL` | `getMobileCenterAddress()` Returns the URL of the UFT Mobile as defined in the LFTRuntime configuration, or null if it is not defined.
    `static java.lang.String` | `getMobileCenterUserName()` Returns the user name of the UFT Mobile as defined in the LFTRuntime configuration, or null if it is not defined.
    `static Device` | `lockDevice(DeviceDescription description)` Obtains a device from the UFT Mobile lab and locks it so that only the current UFT Developer test can perform actions on it.
    `static Device` | `lockDevice(DeviceDescription description, ApplicationDescription[] appsToInstall)` Obtains a device from the UFT Mobile lab and locks it so that only the current UFT Developer test can perform actions on it.
    `static Device` | `lockDevice(DeviceDescription description, ApplicationDescription[] appsToInstall, DeviceSource deviceSource)` Obtains a device from the UFT Mobile lab and locks it so that only the current UFT Developer test can perform actions on it.
    `static Device` | `lockDevice(DeviceDescription description, DeviceSessionOptions sessionOptions)` Obtains a device from the UFT Mobile lab and locks it, so that only the current UFT Developer test can perform actions on it.
    `static Device` | `lockDeviceById(java.lang.String deviceId)` Obtains a device from the UFT Mobile lab and locks it so that only the current UFT Developer test can perform actions on it.
    `static Device` | `lockDeviceByInfo(DeviceInfo deviceInfo)` Obtains a device from UFT Mobile lab and locks it so that only the current UFT Developer test can perform actions on it.
    `static Device` | `lockDeviceByName(java.lang.String deviceName)` Obtains a device from the UFT Mobile lab by device name and locks it so that only the current UFT Developer test can perform actions on it.
    `static Device` | `tryLockDeviceByInfo(DeviceInfo deviceInfo)` Checks whether a device is available in the UFT Mobile lab and if so, locks it, so that only the current UFT Developer test can perform actions on it. If this method fails, the test continues without an exception.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MobileLab

          public MobileLab()

  - ### Method Detail

    - #### lockDevice

          public static Device lockDevice(DeviceDescription description)
                                   throws GeneralLeanFtException

      Obtains a device from the UFT Mobile lab and locks it so that only the current UFT Developer test can perform actions on it.
      Parameters:
        `description` - the description of the device to obtain.
      Returns:
        the requested device.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution

    - #### lockDevice

          public static Device lockDevice(DeviceDescription description,
                                          ApplicationDescription[] appsToInstall)
                                   throws GeneralLeanFtException

      Obtains a device from the UFT Mobile lab and locks it so that only the current UFT Developer test can perform actions on it.
      Parameters:
        `description` - the description of the device to obtain.
        `appsToInstall` - an array of ApplicationDescription representing the applications to install.
      Returns:
        the requested device.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution

    - #### lockDevice

          public static Device lockDevice(DeviceDescription description,
                                          ApplicationDescription[] appsToInstall,
                                          DeviceSource deviceSource)
                                   throws GeneralLeanFtException

      Obtains a device from the UFT Mobile lab and locks it so that only the current UFT Developer test can perform actions on it.
      Parameters:
        `description` - the description of the device to obtain.
        `appsToInstall` - an array of ApplicationDescription representing the applications to install.
        `deviceSource` - the lab, platform, or service hosting the device.
      Returns:
        the requested device.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution

    - #### lockDevice

          public static Device lockDevice(DeviceDescription description,
                                          DeviceSessionOptions sessionOptions)
                                   throws GeneralLeanFtException

      Obtains a device from the UFT Mobile lab and locks it, so that only the current UFT Developer test can perform actions on it.
      Parameters:
        `description` - the description of the device to obtain.
        `sessionOptions` - a `DeviceSessionOptions` object supplying session options.
      Returns:
        the requested device.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution

    - #### lockDeviceById

          public static Device lockDeviceById(java.lang.String deviceId)
                                       throws GeneralLeanFtException

      Obtains a device from the UFT Mobile lab and locks it so that only the current UFT Developer test can perform actions on it.
      Parameters:
        `deviceId` - the ID of the device in UFT Mobile.
      Returns:
        the requested device.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution

    - #### lockDeviceByName

          public static Device lockDeviceByName(java.lang.String deviceName)
                                         throws GeneralLeanFtException

      Obtains a device from the UFT Mobile lab by device name and locks it so that only the current UFT Developer test can perform actions on it.
      Parameters:
        `deviceName` - the name of the device in UFT Mobile.
      Returns:
        the requested device.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution

    - #### lockDeviceByInfo

          public static Device lockDeviceByInfo(DeviceInfo deviceInfo)
                                         throws GeneralLeanFtException

      Obtains a device from UFT Mobile lab and locks it so that only the current UFT Developer test can perform actions on it.
      Parameters:
        `deviceInfo` - a DeviceInfo object containing the information of the device to lock.
      Returns:
        the locked device.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution

    - #### tryLockDeviceByInfo

          public static Device tryLockDeviceByInfo(DeviceInfo deviceInfo)
                                            throws GeneralLeanFtException

      Checks whether a device is available in the UFT Mobile lab and if so, locks it, so that only the current UFT Developer test can perform actions on it.
      If this method fails, the test continues without an exception.
      Parameters:
        `deviceInfo` - a DeviceInfo object containing the information of the device to lock.
      Returns:
        true if the locking operation succeeded, otherwise false.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution

    - #### getDeviceList

          public static DeviceInfo[] getDeviceList()
                                            throws GeneralLeanFtException

      Returns a list of DeviceInfo for all devices in UFT Mobile.
      Returns:
        a list of DeviceInfo for all devices in UFT Mobile.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution

    - #### getMobileCenterAddress

          public static java.net.URL getMobileCenterAddress()
                                                     throws GeneralLeanFtException,
                                                            java.net.MalformedURLException

      Returns the URL of the UFT Mobile as defined in the LFTRuntime configuration, or null if it is not defined.
      Returns:
        the URL of the UFT Mobile as defined in the LFTRuntime configuration, or null if it is not defined.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution
        `java.net.MalformedURLException` - if the URL syntax malformed

    - #### getMobileCenterUserName

          public static java.lang.String getMobileCenterUserName()
                                                          throws GeneralLeanFtException

      Returns the user name of the UFT Mobile as defined in the LFTRuntime configuration, or null if it is not defined.
      Returns:
        the user name of the UFT Mobile as defined in the LFTRuntime configuration, or null if it is not defined.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution

Tips to improve your search results... UFT Developer Java SDK Reference Version 15.0-15.0.2 UFT Developer SDK Reference All View Local Help Center View Online Help Center back Go back in browser history forward Go forward in browser history Remove search highlights next topic Go to next topic previous topic Go to previous topic Print the current topic Version: