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:
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.
-
JSR223 Sampler
The JSR223 component allows you to control everything through a script language.
-
Debug Sampler
The debug sampler can logs variables and properties during Validations.
Controllers¶
-
Simple Controller
Simple controllers are converted to Containers. The Container action lets you organize your logic actions and measure their collective response time.
-
Transaction Controller
Transaction controllers are converted to Containers. The Container action lets you organize your logic actions and measure their collective response time.
-
Random Controller
The random container plays a random child action on each iteration.
-
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.
-
If Controller
The If Action allows you to control whether its children are run or not.
-
Loop Controller
The Loop Action runs its children for a predefined number of iterations.
-
While Controller
The While Action runs its children until its condition is "false".
-
ForEach Controller
A ForEach Action loops through the values of its input variable.
-
Module Controller
Module controllers are converted to link actions. The Link Action lets you share sections of your Virtual Users.
Config elements¶
-
CSV Data Set Config
Provides a list of values to be shared among virtual users.
-
DNS Cache Manager
Allows resetting the DNS cache and other similar options. It is available in the runtime menu.
-
HTTP Authorization Manager
This is merged into the servers menu.
-
HTTP Cache Manager
Offer options to manage client cache behavior. It is available in the runtime menu.
-
HTTP Cookie Manager
Offer options to manage client cookie behavior. It is available in the runtime menu.
-
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.
-
User Defined Variables
These constant values are imported as constant variables.
-
Random Variable
These random values are imported as random variables.
-
Counter
The counters are imported as counter variables.
Assertions¶
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.
Post-processors¶
-
Regular Expression Extractor
Regular Expression Extractors lets you extract values from HTTP responses.
-
JMES Path Extractor
JMESPath Extractors lets you extract values from HTTP JSON response bodies, using JMESPath expressions.
-
JSON Path Extractor
JSONPath Extractors lets you extract values from HTTP JSON response bodies, using JSONPath expressions.
-
CSS/JQuery Extractor
CSS/JQuery Variable Extractors lets you extract variables from HTML responses using CSS/JQuery.
-
XPATH1 Extractor
XPath1 Variable Extractors lets you extract variables from HTML/XML responses using XPath1 queries.
-
XPATH2 Extractor
XPath2 Variable Extractors lets you extract variables from HTML/XML responses using XPath2 queries.
-
JSR223 PostProcessor
JSR223 PreProcessor are scripts that execute after their parent action.
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.
-
Graphite
The Graphite External reporting allows you to send metrics to your own Graphite database.
-
Dynatrace
Sends metrics to your dynatrace account.
-
Datadog
Sends metrics to your datadog account.
-
Elasticsearch
The Elasticsearch External reporting allows you to send metrics to your own Elasticsearch database.
Plugins¶
- Standard set,
- And Selenium WebDriver,
- See the dedicated page for other known plugins. They will be imported as generic.
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 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:
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:
The other virtual user will be a standard JMeter user but with a link action pointing to the fragment virtual user:
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:
The include controller points to this other 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:
In OctoPerf the result will be visually similar to the module controller:
If you want to get a real example, you can use this file: buyer.zip, import it and replay it in OctoPerf.
JMeter 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.