Skip to content

Convert a LoadRunner VuGen Script to JMeter with Claude or ChatGPT

Teams move from LoadRunner to JMeter for cost, for CI pipelines, or because a new project already uses it. The scripts are the painful part. Years of VuGen scripts full of web_url, web_submit_data and correlation rules do not open in JMeter. AI tools can speed this up a lot, because the mapping between the two is mostly mechanical. They also make confident mistakes, so the method matters.

Mapping table: web_url and web_custom_request become HTTP Request samplers, web_submit_data becomes an HTTP Request with parameters, web_reg_save_param_ex becomes a Boundary or Regex Extractor, transactions become Transaction Controllers, parameter files become CSV Data Set ConfigVuGen to JMeter: what maps to whatweb_url / web_custom_requestHTTP Requestweb_submit_data (ITEMDATA)HTTP Request + parametersweb_reg_save_param_exBoundary / Regex Extractorlr_start/end_transactionTransaction Controller.dat parameter fileCSV Data Set Config{param}${param}
Most web functions have a direct JMeter element.

What converts and what does not

Before you start, sort your scripts. Web HTTP/HTML scripts are good candidates. Scripts with heavy C logic need more work. Scripts on GUI protocols such as Citrix, SAP GUI or TruClient have no JMeter equivalent, and no AI changes that.

Conversion difficulty: HTTP calls, headers, correlation and data files convert well; custom C code and init or end sections need rework; GUI protocols like Citrix, SAP GUI and TruClient do not convert to JMeterHow well does it convert?Converts wellHTTP calls, headers,correlation, checks,transactions, data filesNeeds reworkC string code,lr_ functions in logic,vuser_init / endDoes not convertCitrix, SAP GUI,TruClient, RDP,other GUI protocols
Web and HTTP scripts are the good candidates.

Step 1: Give the AI one block, not the whole script

Pasting a 2,000-line Action.c gets you a summary, not a conversion. Work one transaction at a time. Remove real user names, passwords and host names first.

Convert this LoadRunner VuGen block (Web HTTP/HTML) to JMeter 5.6.
For each VuGen function, tell me which JMeter element to add, where
it goes in the tree, and every field value: method, path,
parameters, headers, extractor settings.
- web_reg_save_param_ex -> Boundary Extractor with the same LB/RB,
  placed as a child of the request that returns the value
- {param} -> ${param}
- lr_think_time -> tell me where to put a timer
Do not generate JMX XML. List anything you could not convert.

lr_start_transaction("02_Login");
web_reg_save_param_ex("ParamName=csrf", "LB=name=\"_csrf\" value=\"",
    "RB=\"", "Ordinal=1", SEARCH_FILTERS, "Scope=Body", LAST);
web_url("login_page", "URL=https://{host}/login", "Mode=HTML", LAST);
web_submit_data("login",
    "Action=https://{host}/login", "Method=POST", "Mode=HTML",
    ITEMDATA,
    "Name=username", "Value={user}", ENDITEM,
    "Name=password", "Value={pass}", ENDITEM,
    "Name=_csrf", "Value={csrf}", ENDITEM,
    LAST);
lr_end_transaction("02_Login", LR_AUTO);

Note the line "Do not generate JMX XML". AI tools can write a .jmx file, and for a tiny script it may even open. For anything real, generated JMX often has wrong element classes or missing properties, and you spend longer finding the error than building the steps by hand. A clear list of elements and field values is faster to apply and easy to check.

Step 2: Build the steps in JMeter

For the block above, a good answer looks like this:

  • A Transaction Controller named 02_Login.
  • Inside it, an HTTP Request GET /login with a Boundary Extractor child: name csrf, left boundary name="_csrf" value=", right boundary ", match number 1.
  • A second HTTP Request POST /login with parameters username=${user}, password=${pass}, _csrf=${csrf}.
  • Test-plan level: HTTP Request Defaults with the host, an HTTP Cookie Manager, and a CSV Data Set Config for user,pass.

Check the escaping when you copy boundaries. In C, \" is an escaped quote. In the JMeter field you type a plain ". This is the most common slip in converted extractors, by people and by AI.

Process: take one block of Action.c, let the AI describe the JMeter steps, build them in the JMeter GUI, replay with one user and compare with the VuGen replayConvert in small piecesAction.cone blockAI writes theJMeter stepsBuild it inthe GUIReplay with1 userCompare withVuGen replay
One transaction at a time, not the whole script.

Step 3: Replay with one user and compare

Run the new script with one thread and a View Results Tree. Compare each request with the VuGen replay log: same URLs, same parameters, same status codes. Then add a Debug Sampler to see the extracted variables. If ${csrf} shows up literally in a request, the extractor did not match.

Things the AI often gets wrong

  • Ordinal=ALL. VuGen creates param_1, param_2 and param_count. In JMeter use match number -1, which creates param_1, param_2 and param_matchNr. Code that reads the count must change.
  • Think time and pacing. VuGen run-time settings are not in Action.c. Read them from the scenario and add timers or a Constant Throughput Timer yourself.
  • vuser_init and vuser_end. Login once per user usually belongs in a Once Only Controller, or in a setUp Thread Group for shared data.
  • C helper code. String handling and lr_eval_string logic becomes a JSR223 element with Groovy. Ask the AI to translate it, then test it on its own.
VuGenJMeter
web_add_headerHTTP Header Manager
web_reg_findResponse Assertion
lr_think_timeConstant or Uniform Random Timer
Run-time pacingConstant Throughput Timer, or Flow Control Action with a timer
Custom C codeJSR223 with Groovy

Frequently asked questions

Is it faster to re-record in JMeter?
For short flows, often yes. Recording with the HTTP(S) Test Script Recorder plus the AI for correlation can beat a line-by-line conversion. Conversion pays off when the VuGen script holds business logic you would otherwise lose.

Will response times match between the tools?
Not exactly. The tools differ in connection handling, resource downloads and timing details. Compare trends and transaction behaviour, not single numbers.

Can I convert many scripts automatically?
You can script parts of it, but review every converted script with a one-user replay before it goes into a load test.

Tomorrow in the AI in Performance Testing series: correlation in LoadRunner VuGen with AI, from web_reg_save_param_ex boundaries to ORD=ALL and the replay log.

Page views