Dynamic data for JMeter

Preparation

JAVA and JMeter are already installed.

Steps

Create new “Test Plan” and add one “Thread Group” (Threads (Users)).

  • Number of Threads: 1
  • Ramp-Up Period: 1
  • Loop Count Forever: checked
meter thread group

Add to the “Thread Group” one “CSV Data Set Config” (Config Element).

  • Filename: Path to your CSV file
  • Variable Names: LOOP,HOST,PORT,URL
  • Delimiter: ,
  • Allow quoted data: true
  • Recycle on EOF: false
  • Stop thread on EOF: true
jmeter csv data set config

Add to the “Thread Group” one “HTTP Request Defaults” (Config Element).

  • Server Name or IP: ${HOST}
  • Port Number: ${PORT}
jmeter http request defaults

Add to the “Thread Group” one “Loop Controller” (Logic Controller).

  • Loop Count: ${LOOP}
  • Forever: not checked
jmeter loop controller

Add to the “Loop Controller” one “HTTP Request” (Sampler).

  • Method: GET
  • Path: ${URL}
  • Follow Redirects: checked
  • Use KeepAlive: checked
jmeter http request

Add to the “Thread Group” one “View Results Tree” (Listener).

meter view result tree

Rename the “HTTP Request” into “${HOST}:${PORT}${URL}”.

jmeter http request extension

Create the CSV file with some comma separated values (LOOP,HOST,PORT,URL).

jmeter csv

Run

Save the test plan as JMX file and run the test plan.

jmeter result