JMeter - CSV Data Set Config Usage

CSV Data Set Config is 1 of the configuration chemical component of Apache JMeter software charge testing tool. CSV Data Set Config allows yous to read variable values from csv file in addition to thence yous tin give the sack purpose those values inward samples of your software charge essay invention every bit per your requirement. Here nosotros volition see, How to add together CSV Data Set Config inward your software charge essay invention in addition to how to read information from csv file. Let's acquire alongside example.

Add CSV Data Set Config In Software Load Test Plan
You tin give the sack add together CSV Data Set Config nether thread group, controller or asking every bit per your requirement. But delight banking concern annotation 1 affair here, It volition move processed before whatever samplers inward the electrical flow compass regardless of its position. So when yous run test, First it volition procedure CSV Data Set Config in addition to thence it volition execute samplers.

Have yous Read about Synchronizing Timer?

Let's add together CSV Data Set Config nether thread grouping of your software charge essay plan. To create so,
  • Right click on Thread Group,
  • Select Add -> Config Element -> CSV Data Set Config every bit shown inward bellow image.


It volition add CSV Data Set Config nether Thread Group.

Parameters Of CSV Data Set Config
CSV Data Set Config has many dissimilar parameters every bit shown inward bellow ikon to configure it every bit per your requirement. Let me explicate them.

  • Filename : In this field, You tin give the sack laid upwardly CSV information file nurture in addition to it's path. Example : E:\Test.csv
  • File Encoding : This champaign volition move used when encoding is used to read the file.
  • Variable Names : Variable names listing alongside comma-delimited to shop values which are read from csv file. Example : X,Y,Z
  • Delimiter : Delimiter to purpose to split upwardly information during reading it from file. Use comma(,) for comma-delimited file in addition to \t for tab delimited file.
  • Allow quoted data? : If yous wants to read double quoted(") information from file thence laid upwardly it to true. Example : "Y2".
  • Recycle on EOF? : Set it to truthful if yous wants to read information from start of file when reaching on goal of file. Default it volition move true.
  • Stop thread on EOF? : Set it truthful if yous wants to halt thread on end of file if Recycle on EOF? = false.
  • Sharing mode : If guide All threads thence it volition portion file betwixt all threads. If laid upwardly electrical flow thread grouping thence each file volition move opened 1 time per each thread group. If laid upwardly electrical flow thread thence each file volition move opened separately for each thread.
Using CSV Data Set Config In Software Load Test
Scenario : I wants to read data(from iii columns comma-delimited) from csv file in addition to impress inward thought upshot inward tree using Debug.

I accept created really uncomplicated charge essay invention to explicate how to purpose CSV Data Set Config inward software charge essay invention to read information from csv file.

I accept added CSV Data Set Config nether Thread Group every bit shown inward bellow image.


Test.csv file has information similar bellow. You tin give the sack download it from THIS PAGE.


You tin give the sack come across that nosotros accept iii information columns inward csv file thence nosotros accept used iii variables(X,Y,Z) inward CSV Data Set Config.

Thread grouping configuration is every bit bellow. Loop count is xv iterations.


I accept used Debug Sampler to come across all iii variable's values on each thread iteration.


Now if yous volition run inward a higher house test, output of 1st debug sampler volition looks similar bellow.




In 1st debug sampler's result, You tin give the sack come across that CSV file's inaugural off row information is printed. Same way, 2d row's information volition move printed inward upshot of 2d debug sampler's upshot in addition to thence on.

If yous wants to purpose variable's information anywhere inward your software charge essay invention thence yous tin give the sack purpose it this means -> pose ${X} To purpose X variable's value

As yous know, We accept entirely five rows information inward csv file in addition to loop count inward thread grouping is 15. So sixth debug sampler volition impress 1st row's information over again every bit nosotros accept set Recycle on EOF? = truthful in CSV Data Set Config. In this case, It volition start reading information from start of file 1 time accomplish on goal of file.


This way, You tin give the sack use CSV Data Set Config inward your software charge essay invention to read information from csv file.

More interesting articles here :Generation Enggelmundus Internet Marketing Tool here :Zeageat IM http://www.software-testing-tutorials-automation.com/
Post a Comment (0)
Previous Post Next Post