2

In my test scenario I have to test 2 urls with different host and port under same test plan. Is it possible to do so

anu shaji
  • 39
  • 3
  • 8

2 Answers2

1

You can make variable as property and send to jmeter script

Add to Test Plan In User define variables 2 rows:

baseUrl with Value ${__P(baseUrl,localhost)}

port with Value ${__P(port,8080)}

localhost and 8080 are default values you can change it

and when you execute add the values you want e.g.:

jmeterw.cmd ... -JbaseUrl=192.168.0.33 -Jport=80

Ori Marko
  • 56,308
  • 23
  • 131
  • 233
1
  1. Define your host and port combinations in a CSV endpoints.csv file like:

    somehost,someport
    someotherhost, someotherport
    

    and put the CSV file to the "bin" folder of your JMeter installation

  2. Add CSV Data Set Config to your test plan and configure it like:

    JMeter CSV

  3. Set HTTP Request sampler to use ${host} and ${port} variables defined via the CSV Data Set Config

    JMeter HTTP From CSV

That's it, on each iteration (or virtual user hit) the next line will be picked up from the endpoints.csv file.

See Using CSV DATA SET CONFIG article for more information on parameterising JMeter tests using CSV files.

Dmitri T
  • 159,985
  • 5
  • 83
  • 133