Monday, January 7, 2019

How to pass variable data in JMETER request

How to use CSV data set config in Jmeter for passing varible data in JSON request 

To create real-time scenario we need to pass variable data in request. For this we can use “CSV data set config”. Right click on Thread group > Add> Config Element> CSV Data Set Config



You will see CSV data set config like this 



Now we need to create a CSV from which JMETER variable will pick up value and append in Request.  Create CSV and enter data for variable, Here I am passing address line as variable. ( You can open CSV in notepad ). After each address press TAB and then next line new address  , So JMETER can understand multiple variables 


Update configuration  in “CSV data config set”


Filename:- Complete path where file is stored 
Variable Name:- You can give any name to variable 
Ignore First line:- If you specified Name of variable in data sheet at first line then Make it True else False ( I made false) 
Delimiter: -  We used TAB so will use \t for tab 
Allow Quoted data:- If test data is in quotes then make it true JEMTER will omit quotes and will use data inside quotes (Recommended to keep True always) 
Recycle on EOF: - True, It will recycle used data once reaches to end of file 
Stop Thread on EOF:- False , as we want to recycle data 
Sharing mode: - All threads  

Once CSV data set configuration done we need to replace actual address line with variable name ${addressLine} 


Now run test for 5 users, and check result all 5 users sent different address line in request  




Related Posts:

  • Solution- JMTER not working from CMD / NON GUI / Command Promt I was facing this issue when I was trying to run JMETER from CMD/ Command prompt / Non Gui, Even JMETER was working fine in GUI mode. To run I started JMETER in Bin path of JMETER and ran below query C:\tools\… Read More
  • Parsing JSON response and Saving it in CSV  To parse JSON response we need to use JSON Extractor and Bean Shell Post Process (Here we need some do coding) Add JSON Extractor & Bean Shell post processor to thread group Right click on Thread Group> Add>… Read More
  • How to do JMETER Web recording After log time posting new topic. This time I would like to share knowledge about web Recording in JMETER using Badboy software. Actully you can record without using Badboy but still I would like to share recording with… Read More
  • JMETER Tutorial Course Content JMeter Download JMeter Overview JMeter  Enviornment JMeter  Build test plan JMETER -Understanding Thread Group Understanding Listeners in JEMTER API performance testing using JMETER How to pass variable data… Read More
  • How to pass variable data in JMETER request How to pass variable data in JMETER request How to use CSV data set config in Jmeter for passing varible data in JSON request  To create real-time scenario we need to pass variable data in request. For this we can… Read More

0 comments:

Post a Comment

Popular Posts