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:

  • Download and Installation of JMETER on Widnows Mahchine How to download and install  JMETER on Windows Machine  In this topic we will learn about downloading and Installing JMETER from Windows machine. JMETER is JAVA based application so it is completely platfo… Read More
  • Understanding JMETER Listeners Understanding Listeners in JEMTER  :-  Listener displays particulars of sampler requests and responses, and can display basic HTML and XML representations of the response. Other listeners deliver summary or a… Read More
  • Creating Test Plan in JMETER Creating Test Plan in JMETER How to create test plan in JMETER for REST API performance testing? For REST API performance testing we have to start with Test plan in JMETER. The test Plan is where the overall settings… Read More
  • Performance Testing Overview Performance Testing Overview Before starting to understand about  Performance Test life cycle  we  need to understand  What is Performance Testing  What is Performance T… Read More
  • JMETER -Understanding Thread Group In this part of step by step JMETER tutorial we are going to learn about JMETER element “THREAD GROUP” What is Thread Group in JMETER:- Thread group is a place where we actually put number of users (Thread… Read More

0 comments:

Post a Comment

Popular Posts