Skip to content

CSV Content Validation

CSV Content Validation

OctoPerf automatically validates your CSV files to detect issues that could cause problems during test execution. Validation runs when you open or save a CSV variable, and also during Virtual User sanity checks.

When validation runs, you may see errors displayed in the UI. This guide explains what each error means and how to fix it.

Info

Error-level validation issues are blocking and must be fixed before running tests. Warning and Info-level issues are non-blocking, but we recommend fixing them for reliability and security. You can save your variable with warnings or info messages, but tests cannot run with errors.

Note

CSV validation only works with single-character delimiters (such as ,, ;, |, or \t). If your CSV variable uses a multi-character delimiter, validation will not run. In this case, manually review your CSV file for issues.

CSV Validation Errors

OctoPerf checks for 7 types of errors. Here's what they mean and how to fix them.

1. Inconsistent Column Count

What it is: A row has a different number of columns than other rows.

Why it happens: Usually an unquoted comma inside a field value:

username,password,email
user1,pass1,user1@example.com
user2,pass2,my,wrong@example.com  ← Unquoted comma breaks the row
user3,pass3,user3@example.com

Why it matters: Variables will get misaligned values and tests may fail.

How to fix:

  • Enclose the field in double quotes: "my,wrong@example.com"
  • Or use a different delimiter (; or |) if your data doesn't contain those characters

2. Empty Line

What it is: Your CSV file has blank rows.

Why it happens: Common causes include manual editing, accidental paste errors, export issues from spreadsheet software, or trailing blank lines at the end of the file.

Why it matters: Variables will be empty for that iteration, which can cause test failures.

How to fix: Delete all blank rows. Your CSV should only have data rows (no empty lines).


3. CSV Formula Injection

What it is: A cell starts with =, +, -, @, |, or %. Example:

username,data
user1,=dangerous_formula
user2,+data

Why it matters: If you open this CSV in spreadsheet software, these cells execute as formulas. An attacker could use this to steal data or execute code on your computer.

How to fix:

  • Best option: Prefix with a single quote: '=data or '+data
  • Or remove the character if it's not needed

Example:

username,data
user1,'=dangerous_formula
user2,'+data


4. BOM Detected

What it is: Your file has an invisible byte sequence at the very start (Byte Order Mark).

Why it matters: This corrupts your column header names, so variables won't work correctly.

How to fix: Re-save your file as UTF-8 without BOM:

  • Text editor: Look for an encoding indicator or menu option → Select "UTF-8" (not "UTF-8 with BOM")
  • Spreadsheet software: Use "Save As" → Choose UTF-8 CSV format (look for options like "CSV UTF-8" or similar)

5. Control Characters Detected

What it is: Your CSV contains invisible/non-printable characters.

Why it matters: These can corrupt your data or cause parsing errors.

How to fix:

  • Delete the invisible characters from affected cells
  • Or re-export your data from the source application

Tip

Use a text editor with whitespace visualization to see hidden characters


6. Encoding Error

What it is: Your file uses a character encoding (like ISO-8859-1) that doesn't match OctoPerf's expected encoding (UTF-8 is the default).

Why it matters: Special characters (é, ñ, 中文, etc.) will display incorrectly or the file won't open.

How to fix:

  1. Check your file's encoding in your text editor or spreadsheet software:
  2. Look for an encoding indicator or option in the application

  3. Convert to UTF-8:

  4. Open file with detected/current encoding
  5. Use "Save As" or equivalent option to save as UTF-8 (without BOM)

  6. Or set the encoding explicitly in OctoPerf's CSV Variable settings (Encoding field)


7. Validation Error

What it is: An unexpected validation error (rare). This occurs when a file format issue doesn't match the 6 error types above.

Common scenarios:

  • Unusual encoding combination or corrupted encoding detection
  • File permissions preventing proper read access
  • Special characters or formatting that bypassed standard checks

How to fix:

  • Try re-saving your file as UTF-8 in your text editor or spreadsheet software
  • Check file permissions (ensure file is readable)
  • Export fresh from your source application
  • Test with a smaller subset of your data
  • If it persists, contact OctoPerf support with your CSV file and describe any special formatting or data sources

FAQ

Q: I fixed the error but it still shows: why?

A: Try these steps:

  • Save the CSV variable again (validation re-runs on save)
  • Close and re-open the CSV variable (validation runs on load)
  • If the issue persists, check that your fix was actually saved to the file

Q: Can I ignore validation errors?

A: Technically yes. Errors are non-blocking and tests will run. However:

  • Data format errors (columns, encoding) will likely cause test failures
  • Security errors (CSV injection) pose real risks if the file is opened in spreadsheet software

Q: Multiple variables use the same CSV file: do I need to fix it multiple times?

A: No. Fix the CSV file once. All variables referencing it will see the fix automatically after you save.

Q: My CSV looks fine in spreadsheet software but validation fails: what's wrong?

A: Spreadsheet software often hides formatting issues. Try opening the file in a text editor instead to see the actual content and special characters.