JMeter - read CSV depending on property

Viewed 35

Is it possible to read CSV based on set property?

For example, having 2 CSV files with credentials: credentials1.csv and credentials2.csv. If property is set to A, read variables from credentials1.csv. If the same property is set to B, read credentials2.csv

Property would be set only once during initializing the script in the command line

Would it be better to write scripts purely in java than in .jmx?

1 Answers

You can define the CSV Filename with dependency on property using ${__P()} function:

credentials${__P(filenamesuffix)}.csv

And you can send in command line -Jfilenamesuffix=2 to load credentials2.csv file

Related