How to convert LoadRunner script into Jmeter script

 You can Convert LoadRunner below 2 protocol scripts in to Jmeter scripts.

  • 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 converts them into HTTP request samplers.

The easiest way to set up JMeter for recording is to use the JMeter Templates feature. JMeter can be set up 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.

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 that 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 > Runtime Settings(F4)

loadrunner script replay

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

  • Proxy: Use custom proxy Use 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: 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).

You can also 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 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.

Comments

Popular posts from this blog

Lr Advance Param Function In Loadrunner With Example

web_set_max_html_param_len

Error -27492: "HttpSendRequest" failed, Windows error code=12057 (certificate revoked) and retry limit (0) exceeded for URL="