Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to run particular http request to multiple times in jmeter?

Tags:

csv

jmeter

I've multiple http samples in Test Plan but i want to run only one request for multiple times based on csv data set config and remaining http requests will run once particular sample is complete all the iteration based on csv data set config. enter image description here

In above image i've 5 http samples and i've csv data set for first request,once first request is run for entire csv data set test data then another samples should run,please provide solution how to perform this type of operation in jmeter.

like image 804
Rajesh Om Avatar asked Jun 07 '17 11:06

Rajesh Om


People also ask

How do I hit multiple requests in JMeter?

You should add multiple "Thread Group" into a "Test Plan". Inside "Test Plan" Unselect "Run thread groups consecutively". Inside every "Thread Group" configure "Number of Threads(users)" as "1", "Ramp-Up Period" as "0", "Loop Count" as "1". Now, add "HTTP Request" into each "Thread Group".

What is loop controller in JMeter?

The Loop Controller is a way of moving the number of iterations your samplers run away from the Thread Group to provide more control over your scenario profile. Let's look at the controller. JMeter Loop Controller. If we take a Test Plan that manages the loop count using the Thread Group.

How do I create a HTTP request in JMeter?

Create a Test Plan First For JMeter Post Requests Just right click on Test Plan and then click on the element by following this path: Threads (Users) -> Thread Group. Your Thread Group should be added now. And you can keep values in Thread Properties as they are.


2 Answers

you can use Loop Control and provide the number of hits you needed.

  • To go to Loop Control:
  • Right click on the Thread/ThreadGroup
  • Click on Add
  • select the Logic controller
  • Select the Loop Controller
like image 142
Dilip Kumar Muniraju Avatar answered Nov 15 '22 08:11

Dilip Kumar Muniraju


According to the problem, there is a need to execute a particular request to execute in a loop. The loop could be organized in the following way.

 -> Thread Group 
   -> Loop Controller 
       -->Particular Request 
   -> Other Request

enter image description here

The CSV Dataset could be found in Config Element and should contain a path to a particular file with data (e.g. accounts.csv).

Both elements could be located in Loop controller: Add ->Logic Controller -> Loop Controller CSV Data Set : Add -> Config Elements -> CSV Data Set Config.

The loop can run for the exact amount of records in a file if Loop Count is equal to a number of strings in the accounts.csv Forever, it could be stopped by Test Duration automatically or by Stop button.

The CSV Data Set config should have a path to a file with data. If a file contains headers, then Variables will be assigned based on column names from first string, otherwise, it is necessary to provide variables names in configuration.

enter image description here

ANSWER: If you use 9 variables and all of them are set as header names in a file, then don't provide them in CSV Data Set Config. They will be created automatically, so you can use all 9 variables through names in your file. If headers are not provided, set 9 all in a Variable Names field, using comma as separator.

like image 39
sergey.radov Avatar answered Nov 15 '22 09:11

sergey.radov