JMeter scripts

This topic provides an overview of how to upload and run JMeter scripts from LoadRunner Enterprise.

JMeter scripts overview

JMeter is an open source load testing tool for analyzing and measuring the performance of a variety of services, with a focus on web applications. If you work with JMeter tests, LoadRunner Enterprise provides the ability to also run the tests.

By including JMeter (.jmx) scripts in your tests, you can run one or more JMeter tests side-by-side with any other LoadRunner Enterprise tests, giving you a single entry point for executing your performance tests.

Measurements can be viewed online and offline (via LoadRunner Enterprise and Analysis), using the data points from the JMeter tests.

JMeter scripts can be run on a load generator on a Windows or Linux operating system. The Docker installations of Windows and Linux also support JMeter scripts.

Back to top

Prerequisite setup for JMeter scripts

The following are prerequisites for using JMeter scripts:

Installation requirements
  • The LoadRunner Enterprise installation includes an embedded version of JMeter. No other installation or configuration is necessary.

  • Download and install a 32-bit or 64-bit JDK (version 8 or 11) on all load generator machines on which the script will be run. For supported versions of JMeter, see the Support Matrix.

Load generator setup

  • Java setting for Windows: Check that the environment variable %PATH% includes the directory of jvm.dll (for example: %JAVA_HOME%/jdk/jre/bin/server).

  • Java setting for Linux: Check that the environment variable $LD_LIBRARY_PATH includes the directory of libjvm.so.

  • We highly recommended that you set the JAVA_HOME environment variable to point to the Java JDK folder.

LoadRunner Agent settings

  • If the agent is set as Service, change the System environment variables JAVA_HOME and PATH, and restart the load generator machine.

  • If the agent is set as Process, change any User or System environment variables JAVA_HOME and PATH, and restart the agent.

Creating JMeter scripts
  • Create scripts in JMeter and save the scripts locally. The scripts must be saved in ZIP format and must include all the files in the test scripts folder.

  • Include any plugins used in the JMeter script to the <LRE_InstallDir>\bin\jmeter\lib\ext folder since they must be added to the embedded JMeter as well.

  • The file path inside a script folder must not exceed 260 characters.

Back to top

Set up and run a JMeter test

This task describes how to upload JMeter scripts to LoadRunner Enterprise and configure runtime settings.

  1. Make sure you follow the prerequisites for using JMeter scripts.

    For details, see Prerequisite setup for JMeter scripts.

  2. Upload JMeter scripts to LoadRunner Enterprise.

    For details, see Upload a script.

    Note:  

    • When uploading a JMeter script, you can split a .jmx file that contains a number of JMeter groups into a separate .jmx file for each group.

    • After uploading the JMeter script to LoadRunner Enterprise, the script is added to the test management tree and is identified by the icon.

    • If you are using a JMeter script that was uploaded to a version of LoadRunner Enterprise earlier than 2021, you must remove the ManagementEngine.xml file from the zip file.

  3. Create a LoadRunner Enterprise test, and assign the JMeter script to it.

    For details, see Design a test.

  4. Configure JMeter runtime settings.

    If you need to specify a custom JDK path, or parameters, for example, if you want to change the behavior of the JVM, you need to configure the runtime settings.

    1. After you have uploaded a JMeter script to LoadRunner Enterprise and added it to a test, select the test in the test management tree and click Edit Test.

    2. In the Groups and Workload view, select a Vuser group and click Edit Runtime Settings. The JMeter Runtime Settings dialog box opens.

    3. In the JMeter Runtime Settings dialog box, select:

      • Use default JRE path to use the default JRE installation to run JMeter tests. LoadRunner Enterprise searches the path, the registry, and the Windows directory to locate the JRE to be used.

      • Custom JRE path to use a custom JRE installation. Enter the path to the JRE folder and any additional parameters to be passed to Java when the test starts in the Additional parameters box.

  5. Run the test.

    For details, see Manage a performance test run.

    Data points from JMeter tests are displayed in the LoadRunner Enterprise graphs. For details, see View JMeter test results.

Back to top

View JMeter test results

You can monitor JMeter test execution through the following standard graphs:

  • Running Vusers

  • Transaction Response Time

  • Total Transaction per second (Passed)

  • Transactions per second (Passed)

  • HTTP Responses per second

  • Hits per Second

  • Throughput - Whole Load Test

For graph details, see Web resource monitor, Run-Time monitor, and Transaction monitor.

Back to top

Notes and limitations

The following are notes and limitations when working with JMeter scripts in LoadRunner Enterprise:

  • LoadRunner Enterprise supports JMeter scripts that use Web HTTP requests only.

  • If a JMeter JMX script has an associated CSV parameters file, the CSV file must be manually copied onto the load generator running JMeter, to the same location referenced in the JMX file.

    Example:  

    <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="FlightBookParam_CSV_Config" enabled="true">

    <stringProp name="delimiter">,</stringProp>

    <stringProp name="fileEncoding"></stringProp>

    <stringProp name="filename">C:\Parameters.csv</stringProp> //This is the local path to where the script was created in JMX

  • Network Virtualization is not supported for JMeter tests.

Back to top

See also: