Distributed load testing with JMeter
This tutorial shows how to distribute JMeter tests across multiple nodes.
Running large load tests with Apache JMeter often requires distributing test executions across multiple nodes. This approach is necessary when a single node lacks the capacity to generate the target load or when you need to simulate load from multiple geographic locations.
This tutorial shows how to distribute existing JMeter tests across multiple nodes using Step.
Prerequisites
- Access to a Step cluster: Get started quickly by setting up a free SaaS cluster in the Step Portal, or, if preferred, follow the Installation page to configure your own on-premise cluster.
- Install the Step CLI on your local machine as described on the Download page of Step
Test scenario
For the sake of this tutorial, we’ll simulate 10 parallel users visiting our demo online store.
For this simulation we have an existing JMeter test: JMeter sample test
Checkout the sample
Clone the sample project from GitHub:
git clone https://github.com/exense/step-samples
Navigate to the sample directory:
cd step-samples/automation-packages/load-testing-jmeter/
Project structure
Automation package descriptor
The automation-package.yaml
file located at the root of our sample project serves as the automation package descriptor, outlining the details of our load test scenario:
---
schemaVersion: 1.0.0
name: "distributed-load-testing-with-jmeter"
keywords:
# Declare a Keyword which runs the JMeter test Demo_JMeter.jmx
- JMeter:
name: 'JMeter test'
jmeterTestplan: Demo_JMeter.jmx
plans:
- name: "Load Testing plan"
# The agents (workers) are automatically determined and provisioned upon execution
agents: auto_detect
root:
testScenario:
children:
# Declare a ThreadGroup that distributes the execution of the Keyword (and thus the JMeter test)
- threadGroup:
# Distributes across 10 workers
users: 10
# Each worker executes the Keyword 100 times
iterations: 100
children:
- callKeyword:
# Call the defined Keyword
keyword: "JMeter test"
inputs:
# Pass the variable 'URL' to JMeter via Keyword Input
- url: "opencart-prf.exense.ch"
For more details about the syntax, refer to the official documentation of the Automation Package Descriptor.
JMeter test
The JMeter test simulating our user journey is Demo_JMeter.jmx
. It is a standard JMeter test based on JMeter version 5.
For more details about JMeter, refer to the official documentation of the JMeter.
Execute locally
Optionally, you can run the JMeter test locally:
jmeter -n -t Demo_JMeter.jmx
Execute in Step
Before executing the test in Step, you’ll need the URL of your Step instance and an API key. For instructions on generating an API key, refer to Generate an API Key.
To execute the test in Step, run the following command at the root of the sample directory load-testing-jmeter
:
step ap execute --stepUrl=https://<Hostname of your Step cluster> --projectName=Common --token=<Your API key>
This command uploads the content of the automation package to Step and triggers the execution of the plans contained in the automation package descriptor.
Refer to the official documentation of the Step CLI for more details.
The execute
command outputs a direct link to the execution report in Step:
Execute automation package with parameters: {}
The automation package source is ...\step-samples\automation-packages\load-testing-jmeter
Preparing AP archive: ...\Temp\stepcli97053271864881569\load-testing-jmeter.stz
Execution(s) started in Step:
- 'Load Testing plan' (https://<Host name of your Step cluster>/#/executions/66fd1171fda0775568ae802f)
Waiting for execution(s) to complete...
Execution 'Load Testing plan' (https://<Host name of your Step cluster>/#/executions/66fd1171fda0775568ae802f) succeeded. Result status was PASSED
Analyze the result
Open the execution report in Step by clicking the direct link printed by the execute
command above.
In the Performance tab, you can explore the performance metrics:
There you’ll find all performance metrics of your test:
- The metrics related to the samples reported by JMeter
- The total execution time of our Keyword: “JMeter test” which executes the JMeter test
This article demonstrates how to connect Grafana to data generated by Step.
This article demonstrates how to set up distributed system monitoring using Keyword executions, and analyze the results as measurements.
This tutorial demonstrates how to automate interaction with Microsoft Office applications using the Office Interop Assembly.
This article provides documentation for how to integrate JUnit tests into Step.
This tutorial demonstrates how Step can be used to monitor services, availability and performance metrics.
This tutorial demonstrates how to utilize the AutoIt C# binding to automate interactions with Windows applications.
This article demonstrates the automation of mobile applications on Android using the Appium framework.
This article defines three Keywords which will be used in browser-based automation scenarios, using Step and Selenium, as general drivers.
This tutorial shows you how to efficiently set up a browser-based load test using existing Cypress tests in the Step automation platform.
In this short tutorial, we show how to quickly implement a simple browser-based load test based on Cypress scripts in Step.
This tutorial shows you how to set up a browser-based load test using existing Playwright tests in the Step UI.
This article explains Keywords in Step and demonstrates how to create simple ones.
This tutorial demonstrates the design, execution, and analysis of functional tests using the web interface of Step.
This tutorial will demonstrate how to use Step and Selenium to automate various browser tasks.
This tutorial demonstrates how to use Step and Cypress to automate various browser tasks.
This tutorial demonstrates how Selenium automation tests can be turned into full synthetic monitoring using Step.
In this tutorial, you'll learn how to reuse existing Cypress tests to quickly set up and run a browser-based load test using the automation as code approach.
In this tutorial, you'll learn how to reuse existing tests written with Serenity BDD and Cucumber for load testing.
This tutorial demonstrates how Cypress automation tests can be turned into full synthetic monitoring using the automation as code approach.
In this tutorial, you'll learn how to reuse existing Cypress tests to quickly set up and run a browser-based load test using the Step UI.
This tutorial demonstrates how to leverage existing Selenium tests to set up and execute browser-based load tests, following a full code-based approach.
This tutorial demonstrates how to set up a browser-based load test in the Step UI using existing Selenium tests.
This tutorial demonstrates how Playwright automation tests can be turned into full synthetic monitoring using Step.
This tutorial demonstrates how Cypress automation tests can be turned into full synthetic monitoring using the Step UI.
This tutorial will demonstrate how to use Step and Playwright to automate various browser tasks.
In this tutorial, you'll learn how to reuse existing Playwright tests written in Java to quickly set up and run a browser-based load test using the automation as code approach.
This tutorial demonstrates how Playwright tests can be reused for synthetic monitoring of a productive environment in a DevOps workflow
This tutorial shows how to distribute Grafana K6 tests across multiple nodes.
This tutorial demonstrates how Playwright tests can be reused for synthetic monitoring of a productive environment in a DevOps workflow
In this tutorial you'll learn how to quickly set up a protocol-based load test with okhttp
Learn how to set up continuous end-to-end testing across several applications based on Playwright tests in your DevOps pipeline using Step
Learn how to quickly set up continuous browser-based load testing using Playwright tests in your DevOps pipeline
Want to hear our latest updates about automation?
Don't miss out on our regular blog posts - Subscribe now!