Jmeter - testing multiple urls

L P picture L P · May 31, 2013 · Viewed 14.2k times · Source

I'm new to Jmeter; I would like to know how to test multiple urls (stored in a txt/csv file) of different sections of a website in a load test ie. is there any way to import that file and run a load test or any alternative solution?

Thanks!

LP

Answer

Rito picture Rito · Nov 7, 2017

This is how I did it. I have explained it step by step so that any newbie does not have to go through all the documents of Jmeter for figuring it out.

Step 1: Create a Thread Group.

enter image description here

I have named the Thread Group as Demo Test Group.

Step 2: Create a While Controller

enter image description here

A While Controller is created under the Demo Test Group.

Step 3: Create a new variable named path in the condition section.

enter image description here

Step 4: Create a CSV Data Set Config

enter image description here

The CSV Data Set config is created inside the While Controller.

Step 5: Configuring the CSV Data Set.

enter image description here

Make the changes as highlighted in the box. Inside the Filename section enter the csv file location.

The CSV file location should contain only the path. This is how my CSV file looked.

enter image description here

The value inside the Variable Names is same as the name of the variable in While Controller. Which is path.

Step 6: Create HTTP Request

enter image description here

Inside the While Controller create the HTTP Request.

Step 7: Configuring the HTTP Request

enter image description here

I have enter the Domain Name, the Protocol and in the Path section entered the variable {path}, which is picked from the CSV file.

Step 8: Add View Results Tree

enter image description here

You need to add the Listener under HTTP Request. Its purpose to listen to the responses.

Step 9: Run Test

enter image description here

The last step is to run the test.

You can see that the responses is been collected inside the View Results Tree.