Thank you for your comments, we will improve the documentation of this topic.
In the meantime here is some sample code that might be useful:
Path json_filepath = Paths.get(this.getDataPath(), "myFile.json");
String jsonStr = new String(Files.readAllBytes(json_filepath));
jsonStr will contain the entire file contents and can then be processed using a json parser. (Add any external jar file to the VU profile). Note the use of the script method getDataPath to locate the file. This is where managed data files will be held on each injector machine. These files are automatically transferred by the tool as part of the test execution process. (You can manage your own data and pass an absolute path but that is inconvenient.)
To incorporate a managed file into a test:
- Add file as a Data Source in the project. This is achieved by importing: Data Sources (right click) -> New Data Source->Import Data File.
- Bind the file to the Test: Test Level Data->Data Source Bindings