Feb. 6th, 2017

How to Convert LoadRunner Tests to JMeter

If you are moving from LoadRunner to JMeter you might want to convert your existing tests into JMeter format. This article will guide you through the process, so you will be able to perform the transition smoothly and within minimum time.

 

Note: as of the current JMeter version 3.1, you will be able to convert the tests assuming only HTTP(S) protocol (and derivatives). In LoadRunner terms they are:

- Web - HTTP/HTML

- Web Services

 

Preparing JMeter for Recording

 

JMeter comes with a built-in proxy server that enables intercepting HTTP requests that flow through it, and then converting them into HTTP Request samplers.

 

The easiest way for setting up JMeter for recording is by using the JMeter Templates feature. JMeter can be setup for recording in just a few clicks. Just choose “File -> Templates -> Recording” from JMeter’s main menu and then click the “Create” button.

 

JMeter can be setup for recording in just a few clicks. Just choose “File -> Templates -> Recording” from JMeter’s main menu and then click the “Create” button.

 

JMeter will populate a Test Plan that is suitable for HTTP(S) traffic recording. All you need to do is expand “WorkBench -> HTTP(S) Test Script Recorder” and click the “Start” button.

 

Once you click the “Start” button JMeter will show you a message telling that a certificate was created in JMeter’s “bin” directory.

 

JMeter will show you a message telling that a certificate was created in JMeter’s “bin” directory.

 

This doesn’t indicate any error, it is just an information message regarding the ApacheJMeterTemporaryRootCA.crt certificate creation in JMeter’s “bin” folder. If you are recording HTTP traffic - you can just ignore it. If you are about to record HTTPS traffic - you will need to install the certificate in your browser or mobile device, see the Recording HTTPS Traffic with JMeter's Proxy Server guide for more details on it.

 

If you didn’t change any default settings, JMeter’s proxy should be now running on port 8888 of the machine where JMeter lives.

 

Preparing LoadRunner for Recording

 

The whole idea of converting a LoadRunner test to JMeter is replaying a test in LoadRunner by using JMeter as a proxy, so JMeter can capture the requests and convert them to its own Test Plan format. Therefore, you need to “tell” LoadRunner to use JMeter as a proxy.

 

1. Open LoadRunner VuGen

2. Open the script you want to convert into JMeter format

3. Click “Replay -> Settings”

 

loadrunner script replay

 

4. In the “Runtime Settings” locate “Internet Protocol -> Proxy” and amend the configuration as follows:

- Proxy: Use Custom Proxy

- Use the proxy server

- HTTP Proxy: enter the IP address or hostname of the machine, where JMeter is running. If VuGen and JMeter are running on the same machine - type localhost there.

- Port: use 8888 (unless you changed the port in JMeter’s HTTP(S) Test Script Recorder

- If you will be recording HTTP(S) traffic check Use the same proxy for all protocols box

- Make sure that Do not use a proxy server for local (Intranet) addresses is NOT CHECKED

 

loadrunner jmeter configuration

 

5. Just in case, double check you have 1 iteration under “General -> Run Logic”. There is no need to record test iterations, it is better to handle them in JMeter on the Thread Group level or with a Loop Controller.

 

double check you have 1 iteration under “General -> Run Logic”. There is no need to record test iterations, it is better to handle them in JMeter on the Thread Group level or with a Loop Controller.

 

That’s it, you can now hit F5 (or click “Replay -> Run”) to kick off your LoadRunner test execution. JMeter will record all the HTTP requests and you will be able to observe them under JMeter’s Recording Controller. Here is what the recording process should look like:

 

Converting loadrunner to jmx

 

Next Steps

 

Once you have test script “skeleton”, you will most likely need to manually correlate dynamic values by using JMeter PostProcessors (Regular Expression Extractor, CSS/JQuery Extractor, etc).

 

OR you can use the BlazeMeter Proxy Recorder instead of JMeter’s HTTP(S) Test Script Recorder. BlazeMeter Proxy Recorder can export tests in “SmartJMX” mode. This mode it will automatically detect any dynamic parameters and generate the relevant test logic to substitute hard-coded recorded values with the ones extracted from previous responses. This way, you won’t have to take any extra actions. See this How to Cut Your JMeter Scripting Time by 80% article for further details.

 

This is one way you can quickly convert your existing LoadRunner scripts into JMeter format and start enjoying the benefits of using free and open source Apache JMeter for your Load Testing activities.

 

If you have any queries feel free to use below contact form for reaching out to BlazeMeter specialists. Also be aware that CA BlazeMeter offers free LoadRunner to JMeter script consultancy services.

 

Switch your LoadRunner scripts to open-source JMeter and Selenium in minutes, with our free online script converter. Learn more about how to switch, here.

Interested in writing for our Blog? Send us a pitch!