如何同时在JMeter与LoadRunner中录制脚本?
Hey there! Recording scripts in both JMeter and LoadRunner at the same time is totally feasible—here's a practical, step-by-step approach I've used before to get this done smoothly:
1. Pre-Requisites to Get Started
First, make sure you've got both tools installed and updated to their latest stable versions. Also:
- Close any other proxy tools (like Fiddler or Charles) running on your machine—they'll interfere with the recording process
- Pick two unique, unused ports for each tool's proxy (I typically use 8888 for JMeter and 8889 for LoadRunner)
2. Set Up JMeter for Recording
- Open JMeter, right-click on the Workbench, and add an
HTTP(S) Test Script RecorderviaAdd > Non-Test Elements - In the recorder settings, set your chosen port (e.g., 8888) and select a target controller—create a new Thread Group first, then point the recorder to save captured requests here
- For HTTPS sites, generate and install JMeter's root certificate:
- Click "Generate Root CA" in the recorder interface
- Export the certificate file (it'll be named
rootCA.crtby default) - Import this file into your browser's trusted certificates store (steps vary by browser, but look for "Manage Certificates" in settings)
3. Set Up LoadRunner for Recording
- Launch LoadRunner Virtual User Generator (VUGen) and create a new script using the Web HTTP/HTML protocol
- Click the Record button, then in the recording settings window:
- Choose either "Web Browser" or "HTTP/HTTPS" mode (stick with browser mode if you're recording user interactions directly)
- Set your second unique port (e.g., 8889) for the proxy
- Most HTTPS scenarios work out of the box with VUGen, but if you hit certificate errors, you can manually import LoadRunner's root cert from its installation directory
4. Two Ways to Record Simultaneously
Method 1: Proxy Chain (My Preferred Approach)
This lets both tools capture the same traffic in one go:
- Set your browser's system proxy to
localhost:8888(JMeter's port) - Back in JMeter's recorder settings, scroll to the Request Filtering section and enable "Forward all requests to"
- Enter LoadRunner's proxy address here:
localhost:8889 - Start JMeter's recording first, then hit record in LoadRunner
- Run through your full business workflow in the browser—both tools will capture every request, with JMeter forwarding traffic to LoadRunner after recording it
Method 2: Sync Separate Recordings
If proxy chaining causes issues, record each script separately but mirror your actions exactly:
- Record the entire workflow once in JMeter, documenting every step (clicks, form inputs, page load waits)
- Turn off JMeter's proxy, switch your browser to use LoadRunner's proxy (
localhost:8889) - Repeat the exact same steps you did for JMeter—no extra clicks or deviations. This ensures both scripts have identical request sequences
5. Post-Recording Cleanup & Validation
- After recording, disable both tools' recording functions and reset your browser's proxy to default (critical for normal browsing!)
- Trim redundant requests: remove things like
/favicon.ico, ad calls, or other irrelevant resources that don't impact your test - Replay each script to verify functionality:
- In JMeter, check response codes and content to ensure requests succeed
- In LoadRunner, use the "Run" button and review the execution log for errors
- Handle dynamic parameters:
- JMeter: Use
Regular Expression ExtractororJSON Extractorto capture values like session IDs or tokens - LoadRunner: Use the
web_reg_save_paramfunction to extract dynamic data before it's needed in a request
- JMeter: Use
Hope this helps you get both scripts recorded without a hitch!
内容的提问来源于stack exchange,提问作者Umamaheswararao
相关产品推荐
相关产品推荐

