0

I am trying to write a JMeter test plan for testing a REST server. The server currently supports about 80 GET requests (plus several POST and PUT requests). Is there any easy way to create HTTP request samplers for all of the GET requests without doing them by hand? Can I put the URLs in a CSV file and bulk-load them? How?

Ralph
  • 31,584
  • 38
  • 145
  • 282

1 Answers1

2

Sure.
You can use CSV Data Set Config to read request details from your csv-file - in loop, under While Controller, with condition = until the end of file.

As http sampler to use along with your requests details you can use one of these:

  1. HTTP Request - jmeter's out-of-the-box sampler;
    hostname, url/path, protocol can be specified as variables extracted from csv entry, but request METHOD is selected from list - so in case of using this sampler you have to set several loops and csv-files - for GET / POST / PUT respectively.
  2. HTTP Raw Request - custom sampler from jmeter-plugins;
    in this case you can completely define all the details and params of request from csv.

Common schema will look like this:

. . .
While Controller
Condition = ${__javaScript("${rMethod}"!="<EOF>",)}
+ CSV Data Set Config
  Filename = requests.csv
  Varible names = rMethod,rHost,rPort,rPath...
+ HTTP Request / HTTP Raw Request
. . .
Aliaksandr Belik
  • 12,725
  • 6
  • 64
  • 90