EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 600+ Courses All in One Bundle
  • Login
Home Software Development Software Development Tutorials JMeter Tutorial JMeter CSV Data Set Config
Secondary Sidebar
JMeter Tutorial
  • JMeter Basic and Advanced
    • What is Jmeter
    • Install Jmeter
    • JMeter API Testing
    • JMeter if controller
    • JMeter JSON Extractor
    • JMeter Recording
    • JMeter CSV Data Set Config
    • JMeter Command Line
    • JMeter Report
    • JMeter HTTP Request
    • JMeter While Controller
    • JMeter with Selenium
    • JMeter Script
    • JMeter Constant Throughput Timer
    • JMeter Random Variable
    • JMeter tool
    • JMeter BlazeMeter
    • JMeter Parameters
    • JMeter Plugins
    • JMeter Performance Testing
    • JMeter load testing
    • JMeter BeanShell
    • JMeter User-Defined Variables
    • JMeter WebSocket
    • JMeter Aggregate Report
    • JMeter Distributed Testing
    • JMeter Summary Report
    • JMeter Response Assertion
    • JMeter Assertion
    • JMeter Thread Group
    • JMeter Loop Count
    • JMeter Variables
    • JMeter Testing
    • JMeter Version
    • Timers in Jmeter
    • JMeter Alternatives
    • JMeter Command Line Options
    • JMeter Ramp Up Period
    • JMeter Plugin Manager
    • JMeter Throughput
    • JMeter Regular Expression Extractor

JMeter CSV Data Set Config

JMeter CSV Data Set Config

Introduction to JMeter CSV Data Set Config

JMeter is a performance and load testing tool for applications and websites. It is open-source and holds an element that enables the user to work on the external dataset in a CSV format. It is known as “CSV data set config.” It reads the lines from a file and divides them into variables. It is easier to implement than the string from file and CSVread options. It is designed to manage higher dimensional data and is useful for testing unique and random values. This article briefly discusses the data set configuration in JMeter CSV.

JMeter CSV data set config overview

The CSV data set config in JMeter is used to view the lines from the given file and can be divided into variables per the requirement. It is also used to test random and unique values. Generating unique random values on run-time is costly in terms of memory and CPU. So the user can create the data before the test. If required, the random data from any file can be implied to combine with a run-time parameter to develop a distinct set of standard values from every execution. For example, concatenation implementation is cheaper than generating the values at every execution.

Create JMeter CSV data set config

The creation of the JMeter CSV data set config is explained in the below steps. Then, the user can execute the test using the data from the pre-defined CSV file and read along with it while executing.

  • Generate a few of the usernames and passwords on their own similar to the data in the CSV file. For example, let tom, sam, joe, and Jim be the username and pas$$, groovy, scala, and secret be the passwords. The comma is a delimiter to separate the values in the CSV files. Finally, save the file with the appropriate name in the same location as the test plan.

JMeter CSV Data Set Config output 1

Start Your Free Software Development Course

Web development, programming languages, Software testing & others

  • In the test plan, create a dataset config by following the steps, test plan -> add -> config element -> CSV data set config. Give the name of your CSV file created in the above step. Provide the variable name in the concerned field; every variable is equal to a single column in the CSV. These variables will be helpful for future reference. Ensure to separate the values using a comma

JMeter CSV Data Set Config output 2

  • Replace the constant data in the login request by fetching the variables from the CSV file.

JMeter CSV Data Set Config output 3

  • In the thread group field, give the number of threads to eight. It should be equal to the count of users in the CSV file. Execute the test. Every request uses distinct data from the created CSV file to log in.

Using JMeter CSV data set config

Provide the filename which should be read. For example, the test plan used in the same location with a .jmx file format should be given input in the CSV file. However, if the CSV file has a different location than the file that belongs to the test plan, then the user should only give the name of the absolute path of the CSV file.

In Windows, it should be C:\desktop\JMeter\name of the file.csv

All in One Software Development Bundle(600+ Courses, 50+ projects)
Python TutorialC SharpJavaJavaScript
C Plus PlusSoftware TestingSQLKali Linux
Price
View Courses
600+ Online Courses | 50+ projects | 3000+ Hours | Verifiable Certificates | Lifetime Access
4.6 (86,560 ratings)

In Mac, it should be /Users /user /Desktop /name of the file.csv

The dot represents the current folder in the test plan. The \ can be used in Windows, Linux, and Mac.

The CSV file is a plain text notepad, so the user can add an extension to it like .txt instead of .csv. But ensure that the format is not changed.

Encoding the file is used to read it irrespective of any platform. The default encoding is applied to read the file and helps the user in all types of data files like double-byte other languages. The user can save the file in Unicode or UTF-8 to ensure the data is not segregated in the window. But in Windows, the default encoding is scripted in ANSI and JMeter when encoding or reading this file will create a problem by breaking the data. To avoid this, enter the same encoding of the file in the required File encoding field under the data set config.

output 4

If the Variable name is null, then the first line in the file is read and interpreted with the same column name list. The variables can be quoted by double-quotes and can be differentiated by delimiters.

output 5

The delimiter is used to separate the records in the file; sometimes, a semicolon or tab can be used. For example, if users need to add a price to the file, they can change the delimiter and set it in the JMeter.

Enable the quoted data, which allows only the delimiter values. If the data has space, it comprises delimiters, and the value is in the downline. So it is solved when double quotes are used. So set True to the double-quotes.

output 6

Recycle on the End of the File; by default, it should be set to true. The options stop thread on EOF should be set to false.

Sharing modes are enabled in all threads, current thread groups, and current threads. All thread in the file is shared between every available thread. It doesn’t work on the request received on thread groups, even if it has occurred in loops. So every request view only one line CSV, assuming that all the data set is at the same level within the thread group.

Conclusion

Hence, the data set config values can be easily implemented in JMeter to view every file thread. It has a unique feature in the current thread group; every file is viewed once for every thread group where the element appears. If a new thread group is initiated, it reads the file from the beginning and assumes that all the data set is present within the same level of the thread group. In the current thread, every file is viewed separately for every user; it is viewed separately for every thread, which signifies that the user has read the file again from the beginning.  Only the loop present in the thread will read the next line.

Recommended Articles

This is a guide to JMeter CSV Data Set Config. Here we discuss the data set configuration in JMeter CSV in brief with an overview. You may also look at the following articles to learn more –

  1. Matlab Read CSV
  2. PostgreSQL Import CSV
  3. R CSV Files
  4. PowerShell Export CSV
Popular Course in this category
JMeter Testing Training (3 Courses)
  3 Online Courses |  9+ Hours |  Verifiable Certificate of Completion |  Lifetime Access
4.5
Price

View Course
0 Shares
Share
Tweet
Share
Primary Sidebar
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Java Tutorials
  • Python Tutorials
  • All Tutorials
Certification Courses
  • All Courses
  • Software Development Course - All in One Bundle
  • Become a Python Developer
  • Java Course
  • Become a Selenium Automation Tester
  • Become an IoT Developer
  • ASP.NET Course
  • VB.NET Course
  • PHP Course

ISO 10004:2018 & ISO 9001:2015 Certified

© 2022 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA
Free Software Development Course

C# Programming, Conditional Constructs, Loops, Arrays, OOPS Concept

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA
Free Software Development Course

Web development, programming languages, Software testing & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more