Answered question

Is there a way to use dynamic file names mapped to variables?

In my tests there is a variable, say "branch", based on which I would need to read data from a particular CSV file containing data for that branch.

For example: There is a CSV file called "BRANCHES.csv" with values like B1, B2, etc. and another set of files "DATA_B1.csv", "DATA_B2.csv", etc. A virtual user only reads from BRANCHES.csv once and each user moves to the next row as the run goes on, cycling through the file when EOF is reached. Based on the branch code read, the script should read data from DATA_B1.csv or DATA_B2.csv or another.

If I try to append the variable mapped to the branch file to the file path of DATA_Bn files, I'm not able to to a substitution and an attempt to hard code such a substitution fails as well. Is there a way to get around this?

S K V.
S K V.

S K V.

Level
0
12 / 100
points
Neil W.
Neil W.

Neil W.

Level
4
5000 / 5000
points
Team

Why wouldn't this work ${${branch_file}.value}?

Did you find this useful ?

No (0)

Yes (0)

0% of users found this answer useful

Other answers

S K V.
S K V.

S K V.

Level
0
12 / 100
points

Why wouldn't this work ${${branch_file}.value}?

It would work. It does work. Found something similar three days after posting the question. Unfortunately, I can't use the tool any more due to other reasons.