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 UFT Developer Security Reference, available from the Micro Focus Support Self-Solve Knowledge Library.

Overview

When you run tests remotely, all of the test's UFT Developer 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 UFT Developer 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 UFT Developer 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 <UFT Developer installation>\SDK\Java to the folder where your test .jar files are located.

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

    1. From a computer where UFT Developer is installed, copy the <UFT Developer 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 UFT Developer in a grid configuration, skip this section. This configuration is handled as part of Set up a UFT Developer grid machine.

On the remote computer where your AUT is installed:

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

  2. Open the UFT Developer runtime engine connection configuration file, <UFT Developer 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
    		},
    		
    	},
    	"connection-mode": "remote-secured",
    	"connection-securityOptions":{
    		"certificatePath": "c:/path/to/your/pfxFile.pfx"
    	}
    }
  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 (TLS level) 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. Optional. The security protocol to use between the two computers. Possible values: any (Default); tls; tls11; tls12;

      any. The connection will use the latest TLS protocol that is supported by both client and server.

Back to top

Before beginning the test run

Test run preparations depend on whether you are using a Standalone UFT Developer or a UFT Developer grid:

Standalone UFT Developer

  • 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.

UFT Developer grid

  • Manually launch the runtime engine as a grid on the grid machine and as a node on the node machines.

    Where Run UFT Developer as a Grid Run UFT Developer as a Node
    Windows Start Menu Micro Focus > UFT Developer > UFT Developer Runtime (Grid) Micro Focus > UFT Developer > UFT Developer Runtime (Grid Node)
    Note: The Start Menu path may be differ depending on the Windows version you are using.
    Linux

    Run ./leanft start --role=grid

    (located in <UFT Developer installation>/bin).

    Run ./leanft start --role=node

    (located in <UFT Developer installation>/bin).

    Mac

    Run ./leanft start --role=grid

    (located in the UFT Developer installation directory).

    Run ./leanft start --role=node

    (located in the UFT Developer installation directory).

  • Make sure your tests describe the environment they need and launch the AUT. For details, see Write tests for a UFT Developer grid.

Back to top

See also:

Got it!
Welcome to the help center for UFT Developer, formerly known as LeanFT. UFT Developer is part of the new Micro Focus UFT family of integrated functional testing solutions.