In my setupThread, I firstly run some code to generate a property containing a file path. I then want to use this file path as the filename parameter for a CSV data set config (still within the setupThread).
My setupThread structure is basically:
- Identify file path and put into property.
- Loop controller
- CSV data set config with {__P(filePath)} as the filename
- Subsequent requests in loop.
I have seen in other questions that using properties should be possible. However, what I've found is that:
On the first run, the property is set (seen in debug sampler) but the csv data set (and subsequent requests) fail as "File 1 must exist and be readable". Here, it doesn't even enter the loop itself (seen with debug sampler or logging "Hello world" etc.).
On the second run, it all works fine. I am assuming this is because the file path property was set beforehand?
I know I can pass in the file path from command line and that should be fine. I can obviously hardcode a default file path alongside the property as a fallback, but that doesn't seem like a good solution either.
I suspect it would all be fine in the scenario where the property was set in setupThread and then the csv data set were in a subsequent thread group. But I need the "subsequent requests" mentioned earlier to run in the setupThread as well.
Any ideas are much appreciated!