Class SrfLab

java.lang.Object
com.hp.lft.sdk.SrfLab

public class SrfLab extends Object
This class can be used to launch browsers or lock devices in the SRF lab.
  • Constructor Details

    • SrfLab

      public SrfLab()
  • Method Details

    • launchBrowser

      public static Browser launchBrowser(BrowserType browserType) throws GeneralLeanFtException
      Launches a new browser tab returning an instance of Browser for the launched browser.
      The returned browser instance is valid until the tab is closed.
      Parameters:
      browserType - browserType of browser to launch. Possible values: BrowserType
      Returns:
      The Browser for the launched browser.
      Throws:
      GeneralLeanFtException - if error occurs during execution
    • launchBrowser

      public static Browser launchBrowser(BrowserDescription description) throws GeneralLeanFtException
      Launches a new browser tab returning an instance of Browser for the launched browser.
      The returned browser instance is valid until the tab is closed.
      Parameters:
      description - the description of the browser to launch.
      Returns:
      The Browser for the launched browser.
      Throws:
      GeneralLeanFtException - if error occurs during execution
    • lockDevice

      public static Device lockDevice(DeviceDescription description) throws GeneralLeanFtException
      Obtains a device from the OpenText Functional Testing Lab and locks it so that only the current 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
    • lockDeviceById

      public static Device lockDeviceById(String deviceId) throws GeneralLeanFtException
      Obtains a device from the OpenText Functional Testing Lab and locks it so that only the current test can perform actions on it.
      Parameters:
      deviceId - the ID of the device in OpenText Functional Testing Lab.
      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 OpenText Functional Testing Lab and locks it so that only the current 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 OpenText Functional Testing Lab and locks it so that only the current 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 source of the device to use. (OpenText Functional Testing Lab, AWS Device Farm, Any)
      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 OpenText Functional Testing Lab and locks it, so that only the current 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
    • releaseEnvironment

      public static void releaseEnvironment(Browser browser) throws GeneralLeanFtException
      Releases the allocated browser environment.
      Parameters:
      browser - the browser environment to release.
      Throws:
      GeneralLeanFtException - if an error occurs during execution
    • releaseEnvironment

      public static void releaseEnvironment(Device device) throws GeneralLeanFtException
      Release the allocated device environment.
      Parameters:
      device - the device environment to release.
      Throws:
      GeneralLeanFtException - if an error occurs during execution