Gatling Java- How to read data from CSV in Java

Can someone explain the syntax to read data from CSV file?
I see the options for Scala but not much detail for Java.
I would appreciate if anyone can guide to proceed.

Hi @agandhi!

The Feeders documentation is available in the 3 languages (Java, Scala, Kotlin).

So, I’m not sure what you are asking for.
If you means to read such data for your own purpose, you will have to reach for an external librairies.


Here I want to read the input(search keywords) from the csv file.

If you’re trying to have a shared stock of keywords in a CSV file and have your virtual users pick from it sequentially or randomly, that’s exactly what feeders are for. Then, please read the documentation, go through the tutorials and/or the Gatling Academy.

If you want a different usage, then that’s something you’ll have to implement yourself as @sbrevet suggested. FYI, Gatling uses and ships the org.simpleflatmapper:lightning-csv java library, so you can possibly use it for your own needs to. In this case, best read the documentation of your CVS library of choice and then ask questions on StackOverFlow.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.