Skip to content

JMeter import

JMeter is an open-source load testing tool capable of recording HTTP requests through a built-in HTTP Proxy. A JMX file is a saved JMeter project in XML format. OctoPerf supports importing JMeter projects in such format.

Info

JMeter projects often rely on external files (i.e. CSV files used in datasets or plugins). Be sure to upload them using the Files Menu after you import your JMX.

Warning

Be extra careful when importing several times the same items, like variables. Identical items are not imported but if you alter a variable value it might be imported a second time with the new value in order to preserve the behavior of the latest imported JMX.

Record

To record a virtual user with JMeter, please follow the JMeter recording guide provided by the Apache Foundation.

Create Virtual User: Import JMX

Upload the JMeter JMX file to create a virtual user:

Create Virtual User from JMX

Simply drop the file in the JMX area or use the Upload new JMX file button.

Then import all resources that your script may need to run, please refer to the Files documentation for more information.

Warning

Some actions are not directly included in the generated Virtual Users after importing a JMeter JMX file:

  • A Virtual User is created for each ThreadGroup, but the execution configuration (number of simulated users, duration, cookies, cache, dns, etc.) takes place in the runtime scenarios in OctoPerf.
  • Constant variables, Random variables and CSV DataSets are imported in the variables section of your project.
  • Servers, protocol, port and their Authorization configuration are imported in the servers section of your project. For security reasons, protocol and port cannot be left empty like in JMeter, in most situations OctoPerf will be able to extrapolate the proper values for both, but if that process fails you can change them from the server menu.
  • All actions related to test recording (i.e. RecordingController) or test results (i.e. ResultAction or ResultCollector) are ignored as OctoPerf comes with its own results and reports.
  • Configuration elements that are not inside a threadgroup may not be imported if they are not in the list of natively supported actions. Typically a JDBC Connection outside of its threadgroup will not be imported.

Natively supported actions

The following elements are natively supported in OctoPerf, all others will be imported as generic actions. Each one of them is linked to its OctoPerf equivalent so that you can check how they will translate in OctoPerf:

Samplers

  • HTTP Request Sampler


    The HTTP Sampler lets you send an HTTP/HTTPS request to a web server.

    Reference

  • JSR223 Sampler


    The JSR223 component allows you to control everything through a script language.

    Reference

  • Debug Sampler


    The debug sampler can logs variables and properties during Validations.

    Reference

Controllers

  • Simple Controller


    Simple controllers are converted to Containers. The Container action lets you organize your logic actions and measure their collective response time.

    Reference

  • Transaction Controller


    Transaction controllers are converted to Containers. The Container action lets you organize your logic actions and measure their collective response time.

    Reference

  • Random Controller


    The random container plays a random child action on each iteration.

    Reference

  • Throughput Controller


    Throughput Controllers are converted to flow controls. The flow control lets you control how often the contained actions are executed during a test.

    Reference

  • If Controller


    The If Action allows you to control whether its children are run or not.

    Reference

  • Loop Controller


    The Loop Action runs its children for a predefined number of iterations.

    Reference

  • While Controller


    The While Action runs its children until its condition is "false".

    Reference

  • ForEach Controller


    A ForEach Action loops through the values of its input variable.

    Reference

  • Module Controller


    Module controllers are converted to link actions. The Link Action lets you share sections of your Virtual Users.

    Reference

Config elements

  • CSV Data Set Config


    Provides a list of values to be shared among virtual users.

    Reference

  • DNS Cache Manager


    Allows resetting the DNS cache and other similar options. It is available in the runtime menu.

    Reference

  • HTTP Authorization Manager


    This is merged into the servers menu.

    Reference

  • HTTP Cache Manager


    Offer options to manage client cache behavior. It is available in the runtime menu.

    Reference

  • HTTP Cookie Manager


    Offer options to manage client cookie behavior. It is available in the runtime menu.

    Reference

  • HTTP Header Manager


    HTTP request headers are stored in each request. If a global header is inside your threadgroup, it will be treated as generic.

    Reference

  • User Defined Variables


    These constant values are imported as constant variables.

    Reference

  • Random Variable


    These random values are imported as random variables.

    Reference

  • Counter


    The counters are imported as counter variables.

    Reference

Assertions

  • Response Assertion


    Response Assertion lets you check that the HTTP responses satisfies conditions.

    Reference

  • Json assertion


    Json Assertion lets you check at runtime the HTTP responses satisfy conditions using Json Path.

    Reference

Timers

All timers are imported either as HTTP request think time or as delays:

  • Constant Timer,
  • Uniform Random Timer,
  • Constant Throughput Timer.

Pre-processors

  • JSR223 PreProcessor


    JSR223 PreProcessor are scripts that execute before their parent action.

    Reference

Post-processors

  • Regular Expression Extractor


    Regular Expression Extractors lets you extract values from HTTP responses.

    Reference

  • JMES Path Extractor


    JMESPath Extractors lets you extract values from HTTP JSON response bodies, using JMESPath expressions.

    Reference

  • JSON Path Extractor


    JSONPath Extractors lets you extract values from HTTP JSON response bodies, using JSONPath expressions.

    Reference

  • CSS/JQuery Extractor


    CSS/JQuery Variable Extractors lets you extract variables from HTML responses using CSS/JQuery.

    Reference

  • XPATH1 Extractor


    XPath1 Variable Extractors lets you extract variables from HTML/XML responses using XPath1 queries.

    Reference

  • XPATH2 Extractor


    XPath2 Variable Extractors lets you extract variables from HTML/XML responses using XPath2 queries.

    Reference

  • JSR223 PostProcessor


    JSR223 PreProcessor are scripts that execute after their parent action.

    Reference

Backend listeners

  • InfluxDB


    The InfluxDB External reporting allows you to send metrics to your own InfluxDB database and display them in your own grafana dashboards.

    Reference

  • Graphite


    The Graphite External reporting allows you to send metrics to your own Graphite database.

    Reference

  • Dynatrace


    Sends metrics to your dynatrace account.

    Reference

  • Datadog


    Sends metrics to your datadog account.

    Reference

  • Elasticsearch


    The Elasticsearch External reporting allows you to send metrics to your own Elasticsearch database.

    Reference

Plugins

Warning

Custom plugins will require plugin files in the Files menu.

Generic actions

Most commonly used test elements are supported natively: a dedicated Virtual User action is created for each one.

All other relevant JMeter test elements will be imported as Generic Actions:

Generic JMeterAction

Generic Actions lets you edit the configuration of the associated JMeter test element (here a CSV dataset config).

However, there are a few limitations:

  • Generic Actions cannot be added to a Virtual User, you can only duplicate existing ones.
  • Their configuration can only be edited, not extended.

At runtime, the Generic Action is converted back to its associated JMeter test element. So you should ensure that it does not break the execution of the test by validating your virtual user.

Warning

Make sure to update file paths to point to the resources/ folder and provide the required files through the Files menu.

Module controllers

JMeter test fragments and module controllers can also be imported. To guarantee that they will work in every situation, we had to restrict module controllers usage so that they can only point to a fragment. In JMeter it would look like this:

JMeter Fragments

And the result of importing such a JMX would be two virtual users, one of them being of "Test Fragments" type and containing the fragments:

Octoperf Fragments

The other virtual user will be a standard JMeter user but with a link action pointing to the fragment virtual user:

Fragments link action

Upon runtime the Buyer virtual user will behave exactly as in JMeter and if there are other virtual users using the same fragments we will be able to properly share it with them as well. This is the main reason why we have to restrict module controller usage to fragments, since otherwise we cannot determine what is required for each virtual user to run properly.

Include controllers

Include controllers behave slightly differently than module controllers in that they point to another JMeter JMX. Since OctoPerf imports the JMX itself, it would work to just upload all the JMX files because the relation between them would be lost.

It is still possible to import them but you must provide a .zip file containing all the relevant JMX files. Let's take an example where we have a main JMX like this one with a single include controller:

Main.jmx

The include controller points to this other JMX:

Sub.jmx

To be properly imported in OctoPerf you must provide a .zip file like this one. The path to all includes must be the same as specified in JMeter, typically with sub folders like this:

Zip structure

In OctoPerf the result will be visually similar to the module controller:

include-octoperf-structure

If you want to get a real example, you can use this file: buyer.zip, import it and replay it in OctoPerf.

JMeter plugins

Plugins

All JMeter plugins (even custom ones) are supported using Generic Actions.

Plugins are automatically downloaded just before runtime. In case of On-Premise Agents that would not have access to JMeter plugins, you should provide the JAR files in advance using the files manager.

Info

Check the dedicated plugin page for more information and examples.