Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send parameters from one http request to other in jmeter

Tags:

jmeter

I want to test a web application using JMeter.

I want to know how to transfer parameters from one http request to other, my web app has a login page and I have send my username and password, I am facing problem in this.

like image 563
Satish Reddy Avatar asked Oct 17 '13 08:10

Satish Reddy


People also ask

How do I pass a value from one HTTP request to another in JMeter?

Step to implement the logic for passing the variable value to another Thread Group: Add a 'Regular Expression Extractor' post-processor as a child element of 1.1 HTTP Request (Fetcher) and fetch the value in a variable (say employeeID) Add a 'BeanShell Assertion' and write ${__setProperty(valueToPass,${employeeID})}

How do I hit multiple requests in JMeter?

You should add multiple "Thread Group" into a "Test Plan". Inside "Test Plan" Unselect "Run thread groups consecutively". Inside every "Thread Group" configure "Number of Threads(users)" as "1", "Ramp-Up Period" as "0", "Loop Count" as "1". Now, add "HTTP Request" into each "Thread Group".


1 Answers

Testing of login in jmeter, the proper way to pass the parameter via text or csv file, do the following steps as,

1.Create a text file (or csv file) containing the user names and passwords, separated by commas. Put this in the same directory as your test plan as,

enter image description here

2.Add a CSV DataSet configuration element to the test plan. Name the variables USER and PASS. also,Add a path to the filename in that element (I made sure to check the file path) as,

enter image description here

3.Replace the login name with ${USER} and the password with ${PASS} on the Log in (HTTP Request) Sampler as, enter image description here

Hope this will help you,

like image 103
Chetan Avatar answered Nov 04 '22 19:11

Chetan