Creating Distributed Load Tests

Applies to ReadyAPI 3.52, last modified on April 18, 2024

In this tutorial, you modify a test created using the Creating Your First Load Test tutorial to run it on other computers in your network.

Requirements

To run distributed load tests, you need the following requirements to be met:

  • The ReadyAPI Performance license must be active. Feel free to request a trial on our web site.

  • The LoadUI agent application must be installed and running on Agents. The simplest way is to use the installation file and follow the instructions of the wizard, but you can also install it using the command line.

  • Open the port used for the connection on a computer with LoadUI agent installed. By default, LoadUI agent uses port 1991. This port is used to communicate with ReadyAPI. If you use a proxy or firewall, allow network connections using this port.

  • Make sure that you have network access to the agents that will simulate the test.

Preparing the Project

You need to prepare the project to be able to run it on agents:

  • Clear the Resource Root project property or specify it as an absolute path. LoadUI agent do not support using ${projectDir} and ${workspaceDir} as values of the property.

    Propect Properties: Clear the Resource Root property
  • Make sure that all the external files, for example Excel files in Data Source test steps, are available to the agent and the paths to them are specified as absolute paths.

  • If your project has scripts that address an external library, place this library in the <LoadUIAgent>\bin\ext folder.

  • The LoadUI agent does not use a workspace when running tests. Because of that, scripts that use the getWorkspace() method will not work since the method returns null. You need to modify your scripts to avoid using the workspace object.

  • If your project uses plugins, you need to copy them to the agent machine. To do this, copy all the files from the <User folder>/.soapui/plugins directory on the machine where ReadyAPI is installed to the <User folder>/.soapui/plugins directory on the machine where LoadUI agent is installed. User folders are related to users who run ReadyAPI and LoadUI agent correspondingly.

Adding and Configuring the Agents

To add and configure the agents:

  • In the load test editor, switch to the Distribution page.

    API distributed load testing with ReadyAPI: The Distribution Page

    Click the image to enlarge it.

  • Click on the toolbar.

    API distributed load testing with ReadyAPI: The Add Agent Button
  • For the first agent, select the Running agent option and choose an agent from the list of detected agents. ReadyAPI displays all available agents in the local network. Click OK.

    API distributed load testing with ReadyAPI: The Add Agent Dialog
  • Click again.

  • For the second agent, select the New agent option and enter its IP address or host name in the Host field. You can also specify a different port to be used for the connection. You use this method to connect to agents that are not in your local network. ReadyAPI Performance does not display them on the Running agent list. Click OK

If you configured the agent correctly, it has the connected symbol (). If ReadyAPI cannot connect to the agent, it has the disconnected symbol ().

  • Now, drag the scenarios into the agents. If you add multiple scenarios, ReadyAPI Performance will simulate all of them simultaneously.

    API distributed load testing with ReadyAPI: Created Agents

    Click the image to enlarge it.

    Before starting the test, make sure that both agents are enabled. If an agent is disabled, ReadyAPI will not simulate tests on it.
    API distributed load testing with ReadyAPI: Enabled Agents
  • You can select and add/remove multiple agents at once by selecting the corresponding check boxes of each agent as shown in the below image. You can also Select All or Deselect All agents found in the network by using the corresponding buttons.

    Add/Remove Multiple Agents

    The agents found in the network are sorted by name so that it is easy to keep track of them. When one or more agents are added to the Distribution, while opening the Add Agent dialog again, the added agents' checkboxes are checked in order to show which agents from the list have already been added.

Switching to the Distributed Mode

By default, ReadyAPI does not run tests on agents. You need to switch it to the Distributed Mode before running your load test. To do this, use the drop-down list next to the play button and select Run scenarios on agents. After this, the load test will run on Agents.

API distributed load testing with ReadyAPI: Run Scenarios on Agents

Click the image to enlarge it.

Running the Test

To start the load test, click . ReadyAPI will start simulating requests on both Agents..

Checking Test Results

Switch to the Statistics page. On this page, add a new statistics group (click or ). When selecting statistics to display, you can choose the statistics from the Agent you need. To display the statistics for the Agent, choose the agent name. To display overall test statistics, choose The sum of values for all agents.

API distributed load testing with ReadyAPI: The Add Statistics Dialog

Click the image to enlarge it.

For details about load test results, see Viewing Test Results.

See Also

Load Test Assertions
Load Test Agents
Test Results

Highlight search results