API for generating Jmeter test plans?

2019-06-03 07:30发布

问题:

I would like to programmatically generate basic Jmeter test plans from a dynamic set of URLs and form data (not using the Jmeter GUI manually). Can I use the Jmeter API to do this?
Is it already explained somewhere?
I just need point to start from.

Of course I could reverse engineer the test plan XML format and then write my own custom test plan generator, but that's error prone and whenever the format changes my generator needs to be updated.

回答1:

you could also look at gridinit-dsl language for jmeter. It uses ruby to generate the xml.



回答2:

From what you explain, have a look at CSV DataSet which will read urls from csv file.

This component will Iterate on file and put one line in a set of variables, in your case 1 varirable called "URL" for example.

Then you can use ${URL} in HTTP Sampler and set number of iterations and threads in Thread Group to loop and put the load on different urls.

Use hc31impl or java impl if you hit different hosts.