0

I have a table on the page with maximum of 20 rows and also I created a CSV file with 20 rows in it.

Current Scenario : Jmeter is picking only one row for one user from csv file.

Required: I need jmeter to read all rows (i.e 20) for one user.

Table:

Name1 ---- roll1 --- PhnNumber1 --- date1 --- month1 --- year1 --- Dept1

Name2 ---- roll2 --- PhnNumber2 --- date2 --- month2 --- year2 --- Dept2

Name3 ---- roll3 --- PhnNumber3 --- date3 --- month3 --- year3 --- Dept3

.

.

.

Name20 ---- roll20 --- PhnNumber20 --- date20 --- month20 --- year20 --- Dept20

CSV file: Name --- roll --- PhnNumber --- date --- month --- year --- Dept

1.

2.

.

.

20.

So I do I configure Jmeter to read all 20 data from csv file for one user.

Sandeep Sharma
  • 639
  • 2
  • 9
  • 34

1 Answers1

0

It's not clear in which format you want to ingest the contents of the CSV file.

Given your CSV file looks like:

Name1,roll1,PhnNumber1,date1,month1,year1,Dept1
Name2,roll2,PhnNumber2,date2,month2,year2,Dept2
Name3,roll3,PhnNumber3,date3,month3,year3,Dept3

If you need it fully inline or in a JMeter Variable (hopefully this is what you're looking for) - there is __FileToString() function

enter image description here


If you want individual values you can go for __CSVRead() function

  • ${__CSVRead(test.csv,0)} - will give you Name1
  • ${__CSVRead(test.csv,1)} - will give you roll1
  • ${__CSVRead(test.csv,next)} - will proceed to the next row

enter image description here

If you want something custom - there is __groovy() function where you have the full freedom regarding how to read the file and where and how to store the results

enter image description here

More information on JMeter Functions concept: Apache JMeter Functions - An Introduction

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • Function helper is not an element where I can like "CSV Data Set config" add to Http sampler to the corresponding data of CSV. – Sandeep Sharma Dec 13 '22 at 13:43
  • What I need is an HTTP sampler able to send Parameters with the request and those data coming from a CSV file. And For one user it will take all data of file. – Sandeep Sharma Dec 13 '22 at 13:45
  • Thanks for enlightening me regarding what function helper dialog is. And now let me enlighten you: using this dialog you can generate an appropriate function which will read the file in the way you need and use this function in the HTTP Request sampler's "Body Data" or "Parameters" section, depending on what you're trying to achieve. – Dmitri T Dec 13 '22 at 14:22