Run tests remotely

The instructions below describe how to set up your environment to run tests in a configuration where your test is located on a different computer than the AUT.

Note: In addition to these instructions, before you set up remote run configurations, make sure to review your network topology and read the LeanFT Security Reference, available in your <LeanFT>\help folder or from the HPE Self-Solve Knowledge Base (requires an HPE Passport).

  1. Prepare your test for a remote run

    1. Open the test settings file you plan to use with your test. For example, the App.config file of your Visual Studio project or the leanft.properties file in your Eclipse/IntelliJ IDEA project. Uncomment and edit the following settings:

      • Modify the connection address from ws://localhost:<port> as follows:

        Connection type Format
        Secure (recommended) wss://<RemoteServerAddress>:<port>
        Non-secured ws://<RemoteServerAddress>:<port>

        Make sure the port specified in the connection address is available on the remote computer. If it is not, modify it to a port that is available.

      • Set the autolaunch attribute to false.

      • Optional.  Adjust the connection timeout or response timeout.

      For more details on modifying test settings, see Customize test settings.

    2. Compile your updated test.
  2. Set up the test computer

    On the computer where the test will run:

    1. Deploy all required testing files.

      C# Deploy the compiled configuration file (*.config.dll) and all the LeanFT dlls found in your testing project output folder (for example bin\Debug) together with your testing project dll.
      Java

      Copy the com.hp.lft.report-xx.xx.x.jar, com.hp.lft.sdk-xx.xx.x-standalone.jar, and com.hp.lft.unittesting-xx.xx.x.jar from <LeanFT installation>\SDK\Java to the folder where your test .jar files are located.

    2. If LeanFT is not installed on the computer, copy and configure the HTML Reporting tool.

      1. From a computer where LeanFT is installed, copy the <LeanFT installation>\Tools\Report folder to any location on the test computer.
      2. Define a user environment variable called LEANFT_REPORTBUILDER_DIR. Set the report folder you created in the above step as the value.

    3. Make sure you have a working network connection between the test machine and the remote application machine.

    4. For secure connections, make sure you have a trusted copy of the server's encryption certificate set up on the test machine.

  3. Set up the remote computer

    On the remote computer where your AUT is installed:

    1. If not already installed, run the LeanFT installation. Only the LeanFT runtime engine is required.

    2. Open or create the LeanFT runtime engine connection configuration file, <LeanFT installation folder>\lwe\lightweight-engine\config\config.json.

    3. Copy the following code into the file.

      {
        "connection-mode": "remote-secured",
        "connection-securityOptions":{
            "certificatePath": "c:/path/to/your/pfxFile.pfx",
            "encryptionProtocol": "tls"
        }
      }
      
    4. Enter values as follows:
    5. Setting Description
      connection-mode

      The strategy to be used when verifying external clients (i.e. SDK, Spy, etc.):

      • local-only. Accepts connection only from the local connections.

      • remote-nonsecured. Accepts all connections.
      • remote-secured. Accepts only secure (WSS) connections.
      connection-securityOptions

      Holds the security options of the server, that is, the tunnel security protocol (SSL, TLS) and the certificate to be presented to the clients.

      It is comprised of:

      • certificatePath. The path to the server's encryption certificate. The certificate should be in PFX or cert format with a private key.

      • key. If certificatePath holds a location to a cert file, key should hold the path to the pem file.
      • encryptionProtocol. The security protocol to use between the two computers. Possible values are:

        tls; tls11; tls12; ssl2; ssl3

        Default: tls

  4. Before beginning the run

    • Manually launch the runtime engine from the Start menu.

    • Make sure your AUT is available: 

      • For Web-based applications, make sure your test launches the browser and navigates to the application using BrowserFactory.Launch and Browser.Navigate steps.

      • For other applications, launch the application.

See also: