Run tests remotely

The instructions below describe how to set up your environment to run tests in a configuration in which 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 OpenText Functional Testing for Developers Security Reference, available from the OpenText Support Portal.

Overview

When you run tests remotely, all of the test's OpenText Functional Testing for Developers operations run on the remote computer. This is the computer on which the AUT is located.

Other code statements in your tests, such as opening a file to take notes, are run on the machine on which the test itself is located.

Similarly, the report is generated on the machine on which 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 OpenText Functional Testing for Developers 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 on which you plan to run the test:

  1. Deploy all required testing files.

    C# Deploy the compiled configuration file (*.config.dll) and all the OpenText Functional Testing for Developers 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<Installdir>\SDK\Java to the folder in which your test .jar files are located.

  2. If OpenText Functional Testing for Developers is not installed on the computer, copy and configure the HTML Reporting tool.

    1. From a computer on which OpenText Functional Testing for Developers is installed, copy the <Installdir>\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 OpenText Functional Testing for Developers in a grid configuration, skip this section. This configuration is handled as part of Set up and configure a grid machine.

On the remote computer on which your AUT is installed:

  1. If not already installed, run the OpenText Functional Testing for Developers installation. Only the runtime engine is required.

  2. Open the runtime engine connection configuration file, config.json.

    On Windows, the file is located in %localappdata%\LeanFT\config\. If this folder does not exist, create it.

    On Linux/Mac, open the config.json file for editing from the following location:

    Linux ~/.leanft/config
    Mac ~/Library/Application Support/LeanFT/config

    Note: If this is your first time editing the configuration file, the config folder will be empty. You need to copy the file from:<Installdir>/lwe/lightweight-engine/config

  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 use when verifying external clients (such as SDK or Spy):

    • 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 uses 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 OpenText Functional Testing for Developers or a grid:

Standalone OpenText Functional Testing for Developers

  • Manually launch the runtime engine from the Windows 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.

OpenText Functional Testing for Developers grid

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

    Where Run OpenText Functional Testing for Developers as a Grid Run OpenText Functional Testing for Developers as a Node
    Windows Start Menu UFT Developer Runtime (Grid) UFT Developer Runtime (Grid Node)
    Linux

    Run ./leanft start --role=grid

    (located in <Installdir>/bin).

    Run ./leanft start --role=node

    (located in <Installdir>/bin).

    Mac

    Run ./leanft start --role=grid

    (located in the OpenText Functional Testing for Developers installation directory).

    Run ./leanft start --role=node

    (located in the OpenText Functional Testing for Developers installation directory).

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

Back to top

See also: