1
votes

I am looking to make a combination JMeter extensions that satisfy a few criteria:

  1. Open files at the beginning of the test plan/thread group. One of the files in an excel file used for input. I have the code to read it using apache poi via including the apache tika jar in the jmeter lib folder. The input should then be used in the threads as variables just like it's done with the CSV Data Set Config test element.

  2. Aggregate all results at the end of the test plan/thread group to do calculations on the set of all results.

For #1, Maybe it is possible to do this by extending a config element but I haven't seen how to do this yet. I am also unsure of how to mimic the behaviour of CSV Data Set Config.

For #2 the purpose is to send the final information extracted from the results to a server so saving results to a file is not optimal. The View Results Tree or the View Results in Table elements both create a report of all results so it seems it should be possible to do this.

Edit: How to achieve the above?

1
What is your question?dina

1 Answers

1
votes

Assuming your question as 'How to achieve the above?'

For #1:

First of, I believe it is much easier/simpler (because Simple is better than complex) to get the excel/app to provide csv file for jmeter to consume it using CSV Data Set Config. I mean, write the reading logic somewhere else which will feed into jmeter's test data file. Another option would be to write a JSR223 sampler in a set up threadgroup to read the excel and produce the CSV.

But if you need it anyhow, you will need to write a custom plugin which will inherit from ConfigTestElement and will need to implement TestBean and LoopIterationListener interfaces. Good place to start is here. And the code for CSV Data Set Config is here.

For #2:

If you need POST the result file to server then you can use a tearDown thread group in jmeter which will pick up the file at the end of the test and do a HTTP post request using HTTP Request sampler.

Hope I gave you some direction.