In order to define your own variables and reuse them in your tests, it’s easier to use the User Defined Variables from JMeter.

Here is how to create a variable and use it in an HTTP Request from your JMeter Test Plan.

Steps

1. Open JMeter (here is a more detailed post on how to install JMeter) and Add a Thread Group to your Test Plan

2. Add a HTTP Request Sampler to your Thread Group

3. Right-Click the Thread Group and add User Defined Variables Config Element in your JMeter test
1-add-user-defined-varibles-jmeter

4. Create a new variable: var1 with value www.example.com
2-add-variable-in-user-defined-variables-jmeter

5. Go to the HTTP Request and add the variable name where you want to be replaced with its value, use ${var1}
3-user-variable-in-http-request-jmeter

[Locker] The locker [id=1703] doesn't exist or the default lockers were deleted.

How Much Traffic Can Your Website Handle?