0
votes

I have to assert HTTP JSON Response using JSR 223 assertion. The validation data are stored in multiple, multicolumn CSV files. Each row corresponds to a complete object with multiple fields (column). The HTTP JSON response can match with any of the records. So, I need to perform searching as well in the collection of data. These files are large files (so that I want to load them only once for load test).

What may be a good strategy for me to read assertion data from CSV files only once and access them?

1

1 Answers

0
votes

The correct place to load the test data only once is setUp Thread Group, you can put the code reading the CSV files there.

You can store the objects into JMeter Properties using props shorthand like:

props.put('object_1`, someValue)
props.put('object_2`, someOtherValue)

Example code for the JSR223 Assertion:

if (props.values().contains(prev.getResponseDataAsString())) {
    log.info('response data was found')
} else {
    log.info('response data was not found')
}