LeanFT Grid

The LeanFT grid dynamically allocates machines for test runs according to machine capabilities and test requirements.

In LeanFT 14.50: Supported only for tests written using the LeanFT Java SDK.

From LeanFT 14.51: Supported for tests written using the LeanFT Java or .NET SDK.

Architecture

Use the LeanFT grid to run the same test operations on different environments by changing the parameters the test uses to describe the required environment.

You can also leverage the power of your testing lab and achieve distributed parallel test execution. Do this by running all of your tests on the grid, locally or remotely, letting the grid allocate nodes for each test run, as needed.

The LeanFT Grid configuration includes the following:

A LeanFT grid machine

Allocates a node machine for each test run, based on the testing environment capabilities that your test requires.

On this machine: 

  • Install LeanFT
  • Run the LeanFT runtime engine as a grid
LeanFT node machines 

Machines that you set up with the environments on which you want to test your applications.

On each node:

  • Install LeanFT
  • Run the LeanFT runtime engine as a node

In the node's runtime engine settings, specify the grid it connects to and the capabilities provided by the node.

For more details, see Configure a LeanFT node's runtime engine settings

LeanFT tests

Start each test with a statement that specifies the testing environment capabilities required for this run.

For example:

EnvironmentFactory.get(envDescription);

Run your tests using the grid

Run tests on the grid machine locally or remotely. For each test, the grid selects a connected node whose capabilities match the test's environment description.

  • All of the test's LeanFT operations run on the selected node.

  • Other code statements in your tests are executed on the machine where the test itself is located.

  • The report is generated on the machine where the test itself is located.

Note: When using a LeanFT grid configuration, you can also use StormRunner Functional or Mobile Center for your tests.

Configure the StormRunner Functional or Mobile Center connection details in the grid runtime engine settings.

Back to top

Set up a LeanFT grid system

To set up and use a LeanFT Grid configuration, perform the following steps:

  1. Independently of LeanFT, set up machines with the environments on which you want to test your applications. These are the nodes on which LeanFT will perform the test operations.

  2. Install the LeanFT runtime engine on the grid machine, and on each node machine.

    Caution: Do not use the same machine as both a grid and a node.

  3. On the grid machine, run the LeanFT run-time engine as a grid and define how nodes connect to this grid.

    For details, see Start the runtime engine and Set up a LeanFT grid machine.

  4. On node machines, run the LeanFT run-time engine as a node, and configure the node settings. Specify the following: 

    • The grid this node connects to

    • The testing environment capabilities this node provides

    For details, see Start the runtime engine and Configure a LeanFT node's runtime engine settings.

  5. Make sure that your tests start with a statement specifying the required environment specifications. For example:

    EnvironmentFactory.get(envDescription);

    or

    BrowserFactory.launch(BrowserDescription);

    For more details, see Write tests for a LeanFT grid.

  6. Run your tests locally or remotely on the grid machine. For details, see Run LeanFT tests or Run tests remotely.

    You can run as many tests as you want at the same time. For each test, the grid finds a connected node with the required capabilities and uses it to run the test's LeanFT operations.

Back to top

Running tests remotely using the grid

You can use the LeanFT grid to run your tests remotely. This means that you store your tests and run them on a machine other than the LeanFT grid. When running, the tests connect remotely to the LeanFT grid to run the LeanFT test operations. The grid allocates a node with the environment capabilities requested by the test, and runs the LeanFT test operations on that node. For details, see Run tests remotely.

Back to top

LeanFT grid license consumption

The LeanFT grid can handle four LeanFT operations at once, for each license consumed. To enable the grid to run more than four operations simultaneously, use a concurrent license. As the grid handles requests to run operations, it will gradually consume and release licenses as needed.

In the grid's runtime engine settings, define the following to control the grid's use of licenses:

  • The maximum number of concurrent licenses that this grid machine can consume.

  • The license idle timeout. If no LeanFT operations are running and the timeout expires, the LeanFT license is released. The runtime engine remains active and ready to receive requests, but does not consume a license until it needs to run another operation.

For details, see Configure the grid's runtime engine settings.

Back to top

Locking node machines

To control the load placed on a grid node machine, LeanFT uses a locking system. Each time the grid selects a node to use for a test, it adds a lock on that node. This happens as a the result of the test calling one of the following methods, in which the test describes the environment to use for its operations:

  • EnvironmentFactory.get(EnvironmentDescription)
  • BrowserFactory.launch(BrowserDescription)

For details about these methods, see the Java and .NET SDK references.

Locks are released at the end of the test run.

Do the following:

  • On each node, configure the maximum number of locks that can be placed on that node (default=4). For details, see Grid Connection Settings.
  • On the grid, configure the node-wait timeout This is the number of seconds to wait for one of the relevant nodes connected to the grid to become available for locking. For details, see Node Connection Settings.

Back to top

View grid management data

The LeanFT Grid Management console enables you to view the nodes connected to your grid and the capabilities provided by each node. You can see the number of clients currently using the grid to run LeanFT test operations (number of sessions), the number of licenses in use, and more.

To open the console, make sure the LeanFT grid runtime engine is running and do one of the following: 

  • On the grid machine, browse to: localhost:<Grid management port>
  • From a different machine, browse to: http://<grid address>:<Grid management port>

The Grid management port number is defined in the LeanFT grid runtime engine settings (Default=8080). For details, see Configure the grid's runtime engine settings.

This console provides general information about the grid machine and a table showing information about each node. For each node, you can see the capabilities provided by this node as well as the number of runs it is currently handling:

  • Capabilities include the node's name, operating system, browsers, currently loaded add-ins, and other capabilities defined in the node's settings.
  • CONCURRENT RUNS shows the number of locks currently placed on the node, out of the maximum locks defined for that node.

Back to top

See also: