Creating a csv file in before block to be fed during simulation

Why don’t you use JDBC feeder in order to get users directly from your DB ?


The issue here is that Gatling checks for the existence of your CSV file before the before block is run and therefore before that file exists.
It should work if you move your CSV file creation outside of the before block (and before your scenario definition), as it would then happen when your simulation is loaded, before Gatling checks for the file existence.