Most test plans will depend on some form of static data. Static data is any type of external data that is referenced by your load scripts. Examples include things such as post codes, user logins/passwords. You can upload multiple files for your Flood which are then distributed to each Grid node during execution.
Common use cases are things like static data stored in an external CSV, file attachments to send with a request as a multipart form request or custom scripts included or referenced by your main test plan and the like.
UPLOADING MULTIPLE FILES
Whenever you create a new Flood, simply drag or click to upload multiple files to your Flood. These will then be retrieved and stored in the same path relative to the test plan itself on each Grid node during execution.
Uploading Compressed Files
To save you time you can upload supporting files in
.7z compression formats and we will automatically decompress these on the target file system of the grid nodes.
Accessing the file system
In most cases you can use files you have upload via a relative path to your test plan. In some cases you may need to specify the absolute path which the prefix will always be
/data/flood/files/ on the grid nodes. You can also save and view custom results on the grid during the flood test.
CSV data sets
You can upload a CSV file along with your flood test and this will be made available to each node in the grid. The test data API presented in this article is more to help overcome issues such as guaranteeing uniqueness of data or sharing data from a single source across multiple grid nodes.
Partitioning CSV data sets
It is possible to partition your CSVs into files that then become available to specific grid nodes. This is done via a system property Tricentis Flood will set for each node, which is a 0-based index called node_index and for each grid, called grid_index.
For example, on a 3 node grid, you would create 3 individual CSV files, one for each node e.g. node0.csv, node1.csv and node2.csv to partition your data. You then upload them all with your test plan and in the CSV Data Set Config just refer to the filename programatically using:
If you run a test on multiple grids, there is an additional property called grid_uuid to indicate which grid specified by UUID the test is being run on.
You can see these properties amongst others being set in your log files e.g.
2016/01/20 01:11:16 INFO - jmeter.util.JMeterUtils: Setting Locale to en_US
2016/01/20 01:11:16 WARN - jmeter.JMeter: Removing JMeter property: threads
2016/01/20 01:11:16 WARN - jmeter.JMeter: Removing JMeter property: rampup
2016/01/20 01:11:16 WARN - jmeter.JMeter: Removing JMeter property: duration
2016/01/20 01:11:16 INFO - jmeter.JMeter: Setting JMeter property: uuid=ANnbWoJQxutUGCT4jd5s8Q
2016/01/20 01:11:16 INFO - jmeter.JMeter: Setting JMeter property: node_index=0
2016/01/20 01:11:16 INFO - jmeter.JMeter: Setting JMeter property: grid_uuid=NKIdcWrrvP2HdctdnatYqw
You can easily repeat Floods using the same files. These will be available to you when your repeat the Flood. You can also upload new copies of a file, just remove and add accordingly.
To get the node index in Selenium, you can use this code:
public static final String HOSTNAME = System.getProperty("node_index");
To get the node index in Gatling, you can use this: