If I make the path fixed and then allocate the runtime to another LG, it will fail because the directory path does not exist on the LG.
Attempting to make the path relative (i.e. variables\\blah\\file.txt) also fails because, I assume, that Neoload doesn't assume the path to the project.
Any suggestions, obvious omissions, etc?
What is your NeoLoad version?
Since NeoLoad 5.1 there's a useful variable called "NL-CustomResources". That variable can be used to point to a file that is synchronized between the controller and the LG's.
So let's say you put your file "file.txt" under the "customer-resources" folder in your project folder.
Then that "NL-CustomResources" variable will contain the absolute path on your LG to reach your "file.txt".
If you are using an older NeoLoad version, you can still use the same type of method but instead, create a "resources" folder under your project folder and put your "file.txt" inside.
var test = java.lang.System.getenv("APPDATA");
It will retrieve the user roaming folder. For example, "C:\Users\<USERNAME>\AppData\Roaming"
You just need to append that hardcoded path "\Neotys\NeoLoad\v5.1\nlres" to get your "file.txt".
It's a little bit more complicated than 5.1 procedure but it works.
I hope that this will help you.