Jmeter - testing multiple urls

I am new to Jmeter; I would like to know how to test multiple URLs (stored in the txt / csv file) of different sections of a website in a load test, i.e. is there any way to import this file and run a load test or any alternative solution?

Thanks!

LP

+4
source share
3 answers

Use the CSV DataSet element, which will retrieve one row at each iteration of the main loop and place the variable that you name.

Then put the var field in the httpsampler path. If your var is called url then you put $ {url}

+1
source

Here is how I did it. I explained this step by step so that any newbie did not have to go through all the Jmeter docs to find out.

Step 1. Create a thread group.

enter image description here

I named the thread group as the Demo Test Group .

Step 2. Creating a while controller

enter image description here

A So far, the controller has been created in the demo test group.

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

enter image description here

Step 4. Creating a CSV Dataset Configuration

enter image description here

The CSV set configuration is created inside the While controller.

Step 5: Configure the CSV Dataset.

enter image description here

Make the changes highlighted in the field. Inside the File Name section, enter the location of the csv file.

The location of the CSV file should contain only the path. This is what my CSV file looked like.

enter image description here

The value inside the variable names is the same as the variable name in the While controller. This is the way.

Step 6. Creating an HTTP Request

enter image description here

Inside the While controller, create an HTTP request.

Step 7: Configure the HTTP Request

enter image description here

I entered the domain name, protocol and in the "Path" section I entered the {path} variable, which is selected from the CSV file.

Step 8: Add Search Results Tree

enter image description here

You need to add a listener to the HTTP request. His goal is to listen to the answers.

Step 9: run the test

enter image description here

The final step is to run the test.

You can see that the answers are collected inside the View result tree .

+11
source

Use the JMeter StringFromFile .

A very simple example: read from the file c:/tmp/snip.txt into the jmeter myVar variable.
Add the "User Defined Variables" element to the configuration file:

  • name: myVar
  • value: ${_StringFromFile(c:\tmp\snip.txt,myVar,,)}

Then use the ${myVar} variable in your queries.

+4
source

Source: https://habr.com/ru/post/1483761/


All Articles