katebl58
katebl58

Reputation: 143

How do I invoke multiple http requests dynamically in jmeter

I have fetched multiple paths of multiple urls from the JSON response using JSON Path extractor in jmeter. The paths are stored in the jmeter variables like url_0,url_1, url_2 and so on. The server IP address is constant.

These urls fetched from the JSON response have to be invoked after parsing the JSON response as stated earlier. How do I achieve this particular behaviour in jmeter?

Upvotes: 0

Views: 1783

Answers (1)

Dmitri T
Dmitri T

Reputation: 168157

Use ForEach Controller as it described in Using Regular Expressions in JMeter

If you have variables like:

url_0=/some/path
url_1=/some/other/path
url_2=/some/another/path
etc. 

Configure ForEach Controller as follows:

  • Input Variable Prefix: url
  • Start index for loop: -1
  • Output variable name: path
  • Add "_" before number: check

ForEach Controller

And use ${path} variable in underlying HTTP Request sampler

HTTP Request with dynamic path

Upvotes: 1

Related Questions