Next Practical Step
Use \${__groovy(org.apache.jmeter.services.FileServer.getFileServer().getBaseDir())}/file.csv in the CSV Filename field for bulletproof path resolution.
Fix JMeter CSV Data Set Config File not found errors and data sharing issues. Master relative file paths, EOF settings, and multi-thread data distribution.
When executing a test in CLI mode, CI/CD pipelines, or distributed testing, one of the following errors occurs in jmeter.log:
2026-08-18 14:02:11,551 ERROR o.a.j.c.CSVDataSet: java.io.FileNotFoundException: users.csv (The system cannot find the file specified) at java.io.FileInputStream.open0(Native Method)Or a test data logic error occurs:
\${username} in HTTP requests.FileNotFoundException in CLI/CI: JMeter resolves relative CSV paths relative to the current working directory from which the jmeter command was executed, not necessarily the directory containing the .jmx file.| Issue | Cause | Fix |
|---|---|---|
CLI FileNotFoundException | Invoked jmeter from a folder other than the test plan folder | Use \${__P(testdata.path)} or FileServer basedir |
Distributed testing FileNotFoundException | CSV file exists on controller machine but was not copied to remote worker nodes | Copy the CSV file to the exact same file path on all remote worker machines |
| All threads reading same line | CSV Data Set Config placed as child of a Loop Controller | Move CSV Data Set Config to the root of the Thread Group |
| Test stops prematurely | ”Stop thread on EOF” set to true on a small CSV file | Set “Recycle on EOF” to true and “Stop thread on EOF” to false |
| Variables not assigned | ”Variable Names” blank and CSV has no header row | Provide comma-separated variable names in configuration |
To make .jmx test plans fully portable across local GUI, CLI, and CI/CD runners regardless of current working directory:
In CSV Data Set Config -> Filename, use the FileServer basedir function:
${__groovy(org.apache.jmeter.services.FileServer.getFileServer().getBaseDir())}/users.csvOr configure a dynamic property with a default fallback:
${__P(data.dir,${__groovy(org.apache.jmeter.services.FileServer.getFileServer().getBaseDir())})}/users.csvNow you can override data paths dynamically in CI/CD:
jmeter -n -t /plans/checkout.jmx -Jdata.dir=/ci-data/ -l results.jtlThe Sharing Mode setting controls how file pointers advance across virtual users:
| Sharing Mode | Behavior | Best for |
|---|---|---|
| All threads (Default) | Single global file pointer shared across all thread groups. Each thread reads the next unique line | Unique user logins, single-use promo codes |
| Current thread group | Each Thread Group maintains its own independent file pointer | Separate scenarios that need the same test data set |
| Current thread | Each individual virtual user reads the entire CSV file from line 1 independently | Iterating through a fixed list of product IDs per user |
In CSV Data Set Config:
True if you want threads to loop back to line 1 when the file ends.False to allow tests to run for their scheduled duration. Set to True only if the test must stop immediately after exhausting the data file.In distributed mode (jmeter -r):
| Resource | Use when |
|---|---|
| GUI works, CLI fails | File path and working directory differences |
| Functions and variables | Built-in functions like __CSVRead |
| Distributed testing | Managing test data across remote workers |
| CLI Command Builder | Generate CLI commands with dynamic data properties |
__CSVRead() function?Always prefer CSV Data Set Config. It is significantly faster, thread-safe, supports multi-threaded sharing modes, and handles quotes and delimiter parsing properly.
Split the CSV file into chunks before the test run (e.g. split -l 1000 users.csv worker_) and copy chunk 1 to Worker 1, chunk 2 to Worker 2.