Open topic with navigation

com.hp.lft.sdk

## Interface DesktopEnvironment

- All Superinterfaces:
    Environment

      public interface DesktopEnvironment
      extends Environment

  Represents an environment on which LeanFT performs test operations.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `<TTopLevel extends TopLevelObject> TTopLevel` | `describe(Class<TTopLevel> type, Description description)` Describes a top level Window or Dialog test object in this environment.
    `KeyboardDevice` | `getKeyboard()` Returns a `KeyboardDevice` object that enables device replay on the environment.
    `MouseDevice` | `getMouse()` Returns a `MouseDevice` object that enables device replay on the environment.
    `SvInfo` | `getSvInfo()` Returns Service Virtualization Server info. Note: Supported in LeanFT versions 14.52 and later.
    `Aut` | `launchAut(String fileName)` Launches an AUT using the file name.
    `Aut` | `launchAut(String fileName, String... args)` Launches an AUT using the file name and a list of arguments.
    `Aut` | `launchAut(String fileName, String[] args, String workingDirectory)` Launches an AUT using the file name, a list of arguments, and a working directory.

- - ### Method Detail

    - #### describe

          <TTopLevel extends TopLevelObject> TTopLevel describe(Class<TTopLevel> type,
                                                              Description description)
                                                    throws GeneralLeanFtException

      Describes a top level Window or Dialog test object in this environment.
      Type Parameters:
        `TTopLevel` - The generic type of the top level test object.
      Parameters:
        `type` - The test object type - Window or Dialog.
        `description` - The `Description` of the top-level Window or Dialog test object.
      Returns:
        the described top-level test object.
      Throws:
        `GeneralLeanFtException` - if error occurs during execution.

    - #### getMouse

          MouseDevice getMouse()

      Returns a `MouseDevice` object that enables device replay on the environment.
      Returns:
        the mouse device replay object.

    - #### getKeyboard

          KeyboardDevice getKeyboard()

      Returns a `KeyboardDevice` object that enables device replay on the environment.
      Returns:
        the keyboard device replay object.

    - #### getSvInfo

      Supported in LeanFT versions 14.52 and later.

          SvInfo getSvInfo()
          		throws GeneralLeanFtException

      Returns Service Virtualization Server info

      Returns:
        Object of type SvInfo, containing Service Virtualization information
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### launchAut

          Aut launchAut(String fileName)
                        throws GeneralLeanFtException

      Launches an AUT using the file name. To use this method, you must create an application whitelist file. For details, see Add SDK code to your tests in the LeanFT Help Center.
      Parameters:
        `fileName` - The name of the AUT file to launch. Specify only the name, or the full or relative path to the file.
      Returns:
        the launched AUT.
      Throws:
        `GeneralLeanFtException` - if error occurs during execution.

    - #### launchAut

          Aut launchAut(String fileName,
                      String... args)
                        throws GeneralLeanFtException

      Launches an AUT using the file name and a list of arguments. To use this method, you must create an application whitelist file. For details, see Add SDK code to your tests in the LeanFT Help Center.
      Parameters:
        `fileName` - The name of the AUT file to launch. Specify only the name, or the full or relative path to the file.
        `args` - A list of arguments.
      Returns:
        the launched AUT.
      Throws:
        `GeneralLeanFtException` - if error occurs during execution.

    - #### launchAut

          Aut launchAut(String fileName,
                      String[] args,
                      String workingDirectory)
                        throws GeneralLeanFtException

      Launches an AUT using the file name, a list of arguments, and a working directory. To use this method, you must create an application whitelist file. For details, see Add SDK code to your tests in the LeanFT Help Center.
      Parameters:
        `fileName` - The name of the AUT file to launch. Specify only the name, or the full or relative path to the file.
        `args` - A list of arguments.
        `workingDirectory` - A working directory.
      Returns:
        the launched AUT.
      Throws:
        `GeneralLeanFtException` - if error occurs during execution.