A password in your JMeter CSV Data Set Config file contains the delimiter. What happens?
answer
- A value that contains the separator
- There is a checkbox for exactly this
- Two quote characters mean one
- Missing fields leave old values untouched
basics
~20 sThe row splits into an extra field unless Allow quoted data is ticked and the value is wrapped in double quotes. Without it, later variables take the wrong fragments, and a variable the row cannot fill keeps its previous value.
solid answer
~40 sWith `Allow quoted data` unticked, JMeter's `CSV Data Set Config` simply cuts the line at every `Delimiter` occurrence and does no quote handling at all, so a password containing a comma becomes two fields and shifts every later column by one. Tick `Allow quoted data` and a real CSV reader runs: a value enclosed in double quotes may contain the delimiter, the enclosing quotes are removed, two doubled quotes inside a quoted value mean one literal quote, and a quoted value may even span line breaks. The second half of the problem is quieter — the element copies values into variables position by position and **stops at whichever list runs out first**, so a variable the row cannot fill is not written and silently keeps the value the previous iteration left in it.
go deeper
Recall that Allow quoted data exists and is off by default, and that it is what lets a value contain the delimiter. Know that the Delimiter field takes \t for a tab.
Explain the two parsing paths, the doubled-quote escape, and the positional copy that stops at the shorter of the two lists, leaving unfilled variables at their previous values.
Recognise the failure from the outside: well-formed requests, plausible server rejections, a file that still looks intact. Say how you would reproduce it with one thread and a deliberately short row.
Own the shape of the data files themselves: which separator is safe for free-text columns, whether every row must be full width, and where that contract is stated so plan authors do not each rediscover it.
## Two parsers, one checkbox JMeter's **CSV Data Set Config** reads a row one of two ways, and `Allow quoted data` picks which: - **Unticked** — the line is cut at every occurrence of the `Delimiter`, with no quote handling whatsoever. A `"` in the file stays inside the variable, and a value containing the delimiter simply becomes two values. - **Ticked** — a real CSV reader runs. A value enclosed in double quotes may contain the delimiter, the enclosing quotes are stripped, **two double quotes inside a quoted value mean one literal quote**, and a quoted value may contain line breaks, so one logical record can span several physical lines. JMeter's own manual gives the canonical row: ``` 1,"2,3","4""5" ``` With `Allow quoted data` ticked that is three fields — `1`, `2,3` and `4"5`. With it unticked it is four, three of which still carry quote characters. ## The short-row rule that hides the damage The element copies values into variables position by position and **stops at whichever list runs out first**. Variables with no value on this row are not written at all, so they keep whatever the previous iteration left in them: | Variable Names | Row read (delimiter `,`, quoting off) | `USER` | `PASS` | `MFA` | |---|---|---|---|---| | `USER,PASS,MFA` | `u42,pa,ss,123456` | `u42` | `pa` | `ss` — and `123456` is dropped | | `USER,PASS,MFA` | `u43,pw43` | `u43` | `pw43` | unchanged from the previous iteration | For a login file that is the worst possible failure shape: - the request is well formed, so nothing in the plan objects; - the password sent is a fragment of the real one, so the server rejects it for a plausible-looking reason; - a stale `MFA` value from three iterations ago can even succeed, which makes the run look partly healthy; - open the file afterwards and every row is intact, because the file was never the problem. ## Delimiter details worth knowing - Typing the two literal characters `\t` into `Delimiter` is converted to a tab — you cannot type a real tab into the field. - An empty `Delimiter` field falls back to a comma rather than failing. - `Variable Names` is split on **commas** regardless of what `Delimiter` says; its label reads `Variable Names (comma-delimited)`. - Only the first character of `Delimiter` is used by the quoted-data parser, so a multi-character separator is not a supported option when quoting is on. ## A misplaced quote is reported as end of file With `Allow quoted data` ticked, the parser is strict, and three malformed shapes raise an error naming the partial field it had collected: - a `"` inside an unquoted field — *Cannot have quote-char in plain field*; - a lone `"` inside a quoted value, where the doubled form was meant — *Cannot have single quote-char in quoted field*; - a quote that is never closed, which runs to the end of the file — *Missing trailing quote-char in quoted field*. Here is the part worth remembering: `CSV Data Set Config` catches all three, logs them, and then **runs its end-of-file branch**. Every declared variable is set to `<EOF>`, or the thread is stopped if `Stop thread on EOF` is ticked — while thousands of perfectly good rows still sit unread below the bad one. A single stray quote on row 300 of a 10,000-row credential file therefore looks exactly like running out of credentials. ## Fixing it 1. Quote the offending column in the source file and tick `Allow quoted data` — this is the fix that keeps the file readable by everything else. 2. Or pick a separator the data cannot contain and set `Delimiter` to it (`\t` for a tab is the usual choice for free-text columns). 3. Do not rely on a variable being cleared between iterations; if a column is optional, give it an explicit empty field in every row rather than a short row. 4. Verify with a single thread and two iterations, including a deliberately short row, and check what the sampler sent both times.
- With Allow quoted data unticked, what ends up in the variable for a quoted field?The quote characters themselves, because the plain split does no quote processing at all. A field written as "pa,ss" becomes two variables holding "pa and ss" including the quote marks, rather than one value of pa,ss.
- How do you set a tab as the Delimiter in a CSV Data Set Config?Type the two literal characters \t into the Delimiter field; the element converts that to a tab, since you cannot type a real tab into the box. An empty Delimiter field falls back to a comma rather than failing.
- Why is a short row worse than a malformed one for a credential file?A malformed row usually produces a visibly wrong request. A short row leaves the unfilled variable at its previous iteration's value, so the request stays well formed and plausible while quietly reusing stale data, and the file itself still looks correct afterwards.
saying these in an interview costs you the question
- Says JMeter strips double quotes even with Allow quoted data off.
- Assumes a short row blanks the variables it does not fill.
- Escapes an embedded quote with a backslash instead of doubling it.
- Thinks the Delimiter field also splits the Variable Names list.
- Believes a quoted value can never contain a line break.
- Expects a malformed quoted row to be skipped rather than read as end of file.