JMeter新手求助:多URL批量运行及CSV配置与单屏展示方法
Hey there! Let me break this down for you step by step—running 100+ URLs in JMeter and seeing all results in one place is totally doable, and I’ll walk you through exactly how to set it up.
This is super simple—just put one full URL per line in your CSV file. No extra commas, quotes, or formatting needed unless your URLs have special characters (yours don’t look like they do). Here’s what your CSV should look like:
http://10.56.34.67:7065/services/sample/2070 http://10.56.34.67:7065/services/sample1/2070 http://10.56.34.67:7065/services/sample2/2070 ...
Save this file as something like test_urls.csv—make sure it’s saved in JMeter’s bin folder, or you’ll need to use the full file path later (e.g., C:\apache-jmeter-5.6.3\bin\test_urls.csv on Windows, /home/user/apache-jmeter-5.6.3/bin/test_urls.csv on Linux/macOS).
Now let’s set up JMeter to pull URLs from this file:
- Add a Thread Group: Right-click on your Test Plan → Add → Threads (Users) → Thread Group.
- Set the Number of Threads (users) to
1(start with 1 if you’re new; increase later if you want concurrent runs). - Set Loop Count to
Forever—we’ll let the CSV config stop the thread once it finishes all URLs.
- Set the Number of Threads (users) to
- Add CSV Data Set Config: Right-click on your Thread Group → Add → Config Element → CSV Data Set Config.
- In the Filename field, enter
test_urls.csv(or the full path if you didn’t save it in the bin folder). - In the Variable Names field, enter
url—this is the variable we’ll use to reference each URL in our HTTP request. - Check the Stop thread on EOF? box—this tells JMeter to stop processing once it reaches the end of the CSV.
- Leave other settings as default (the delimiter won’t matter since we’re using one URL per line).
- In the Filename field, enter
- Add an HTTP Request: Right-click on your Thread Group → Add → Sampler → HTTP Request.
- In the Path field, enter
${url}—this will automatically pull each URL from the CSV one by one. - You can leave Server Name or IP and Port Number blank because your URLs include the full address and port.
- In the Path field, enter
To see all results in one screen, add these listeners to your Thread Group:
- Summary Report: Right-click Thread Group → Add → Listener → Summary Report. This gives you a high-level overview of all requests (response times, success rates, total requests, etc.).
- View Results Tree: Right-click Thread Group → Add → Listener → View Results Tree. This shows detailed info for each request (request headers, response body, status codes) so you can debug failed calls.
- Aggregate Report: If you want deeper stats, add this too—it breaks down metrics like average, median, and 95th percentile response times.
All these listeners update in real-time as JMeter runs through your URLs, so you can monitor everything in one place.
- If you want to run multiple URLs at the same time, increase the Number of Threads (users) in the Thread Group (e.g., 10 threads would run 10 URLs concurrently).
- Double-check your CSV for typos—even a missing slash can break a request.
- If you get "file not found" errors, verify your CSV path is correct (using the full absolute path eliminates confusion).
内容的提问来源于stack exchange,提问作者Karthick Ricky

