User defined variables in JMeter
Consider a situation where you have several HTTP requests with various parameter settings but identical URLs. You might want to change the URL in the future. If there are hundreds of URLs, you will have to modify each one, which will take a lot of time and be mistake prone.
In these circumstances, JMeter's user defined variables are used.
Follow below steps to add User defined variables:
- Create a Test plan, add Thread group, Sampler, listener. Also add user defined variables.
- Enter blazedemo.com in server for sampler 1 as shown in image:
- In the second sampler, I want to test '/login'. So, I need to specify '/login' as path in HTTP request. And there are two ways to do it, I can either hard-code it as shown in below image or move to separate variable.
- In the user defined variables, enter variable name and path.
Comments
Post a Comment