Setup test data for Jmeter and Junit
Is there a开发者_JAVA百科ny way I can setup my test data for load tests that use Jmeter and Junit? I would like to be able to do something like get a new user from a csv for each thread of a test.
Yes, I've used this a number of times.
See JMeter : Reading variables from a file.
jMeter is an load testing framework based on HTTP. It can simulate multiple users using your website. So there is no concept of setup data. What you can essentially do is do some script to load massive data to load or use one request to store some details and other to retrieve it back. When doing jUnit testing, to load data, you can use dbUnit which can load data for you before testing it.
You can configure a CSV dataset to only be read once, but having only ONE row of data in it.
This will work with JUnit, as the following happens: Junit opens Jmeter script and executes JMeter script. The Jmeter script, when executed, reads from the CSV file, populates all defined data fields and then runs the requests
精彩评论