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 from the Micro Focus Support Self-Solve Knowledge Library (requires a Software Passport).

Overview

When you run tests remotely, all of the test's LeanFT operations run on the remote computer. This is the computer on which the AUT is located.

Other code statements in your tests are executed on the machine where the test itself is located. For example, opening a file to take notes, and so on.

Similarly, the report is generated on the machine where the test itself is located.

Back to top

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, Spring Tool Suite, JBoss Developer Studio, IntelliJ IDEA, or Android Studio 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>

      RemoteServerAddress. The address of the computer on which the AUT is installed.

      Note: If you are using LeanFT in a grid configuration, use the address of the grid machine.

      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.

Back to top

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.

Back to top

Set up the remote computer

Note: If you are using LeanFT in a grid configuration, skip this section. This configuration is handled as part of Set up a LeanFT grid machine.

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 the LeanFT runtime engine connection configuration file, <LeanFT installation folder>\lwe\lightweight-engine\config\config.json.

  3. Copy the highlighted code into the file:

    Note:  

    • The following is an example from Windows.
    • Make sure to copy the section inside the code.
    {
    	"version": 2.0,
    	"port": 5095,
    	"packages": {"Web": {"isEnabled": true}, "Mobile": {"isEnabled": true}, "SAPUI5": {"isEnabled": false}},
    	"idle_shutdown_timeout": 240,
    	"identification_timeout": 20,
    	"proxyInfo": {
    		"proxyAddress": null,
    		"useAuthentication": false,
    		"userName": "user",
    		"encryptedPassword": "0SWoxfcgI8AwDTlJKrk8aA=="
    	},
    	"labs": {
    		"mobileCenter": {
    			"serverInfo": {
    				"address": null,
    				"user": "",
    				"encryptedPassword": "0SWoxfcgI8AwDTlJKrk8aA==",
    				"useProxy": false,
    				"ignoreCertificatesErrors": false
    			},
    			"showVncDuringReplay": false
    		},
    		"srf": {
    			"serverInfo": {
    				"clientID": null,
    				"encryptedClientSecret": "0SWoxfcgI8AwDTlJKrk8aA==",
    				"address": null,
    				"useProxy": false,
    				"ignoreCertificatesErrors": false
    			},
    			"showVncDuringReplay": false
    		}
    	},
    	"connection-mode": "remote-secured",
    	"connection-securityOptions":{
    		"certificatePath": "c:/path/to/your/pfxFile.pfx",
    		"encryptionProtocol": "tls"
    	}
    }
  4. Enter values as follows:

    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

Back to top

Before beginning the test run

Back to top

See also: