How to acheive multiple http requests with csv file in jmeter?

Zeeshan :

I want to simulate a user with 2 http request and 1 http request multiple times via csv file. Below is my structure

Test Plan
- Thread Group *[No. of threads = 2, Ramp-up = 1, Loop count = 1]*
- - View Results Tree
- - Simple Controller
- - - http request 1
- - - http request 2
- - - while controller *[condition = ${no} (variable from csv file)]*
- - - - http request 3
- - - - CSV Data set Config *[Recycle on EOF = False, Stop on EOF = False, Sharing Mode = All threads] and CSV file has 3 records*

Expected: 1 user should execute

http request 1, http request 2, http request 3, http request 3, http request 3 (since csv has 3 records)


  • If i keep Recycle on EOF = False, Stop on EOF = False it keeps on running the request until script ends and after end of data (ie 3 rows) it starts throwing error
  • If i keep Recycle on EOF = True, Stop on EOF = True it runs for only 1 user and stops.
  • If i keep Recycle on EOF = True, Stop on EOF = False it keeps on running the request until script ends
  • If i keep Recycle on EOF = False, Stop on EOF = True it runs for only 1 user and stops.


But can't simulate as per my expectation. Any help would be appreciated. Thanks.

Janesh Kodikara :

It was possible to achieve your objective

http request 1, http request 2, http request 3, http request 3, http request 3 (since csv has 3 records)

With following configuration in the CSV Data Set Config

enter image description here

Following condition was set in the While controller.

${__jexl3("${UNAME}"!="<EOF>")}

Where UNAME is a column name

Since the condition is executed in while controller additional condition check was necessary before executing the http request 3

enter image description here

Please see the structure of the control in the following. enter image description here

Hope this is useful

Also it is possible repeat the test with several iterations with following modifications. Added a JSR223 Sampler for resetting the variable and add text EOF to the end of the CSV file.

enter image description here

Sample JMeter test plan and CSV file are available in the GitHub.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to change HTTP Request Path for multiple HTTP Requests at once in Jmeter

How to make multiple http requests?

Jmeter multiple same Requests

How to group Http requests with transactions in Jmeter HTML Reports?

How to split the CSV file among multiple users & Salve machines for Distributed testing In JMeter

How to use csv file with ForEach controller in JMeter

How to use cell values of .csv file in jmeter?

Jmeter: how to iterate over csv file in batches?

How to execute requests sequentially running multiple JMeter Threads

Angular - How to implement switchMap for multiple http requests?

How to use multiple Http Requests in Angular 4

How to handle multiple http requests in my case?

How to make multiple http requests in my case

How to send multiple HTTP requests using Python

How to send multiple http requests python

Jmeter - How to Loop with requests?

How to test two HTTP requests in Jmeter without affecting the performance of individual requests and how to only record the results of one?

Delay between HTTP requests which is from a CSV file

JMeter - multiple user taking unique row from CSV file

Getting multiple values from a single cell in .CSV file in jmeter

How do I acheive data span across multiple regions (not replication) with Azure SQL

Prevent multiple HTTP requests

How to perform HTTP PUT Request by reading values from CSV in JMeter?

Run Http requests in certain order JMeter

Does Apache JMeter support http/2 requests?

Maintain State Between HTTP Requests to Keycloak in JMeter

How to send concurrent requests in Jmeter

How to execute Ajax requests in JMeter?

How to extract response data JSON and save variable to CSV file in Jmeter