I'm new in J-meter maybe what I ask it's easy but this is what i want to do.
First I got users in format user.namer.xN meaning user.namex1, user.namer.x2 and so on.
I want to do the following each user to send 50 reqeusts and after every 50 request(after each users request) one request to url which contains link for DB restore handler. In the 50 requests that every user sends there is one different number that I want to read from CSV file. I want to end the test when I send 1500 reqests. So the test I wonder would look something like this..
counter 1 to 30
thread group 30 1 1
loop 50
csv (varibale name ID)
requests -------- How can I make on every loop to take other CSV variable
end of loop
request to the handler
Any help
the CSV data set config reads each line when staring each thread.
This is explained here:
http://jmeter.apache.org/usermanual/component_reference.html#CSV_Data_Set_Config
So you cannot use it the way you want. I can see two solutions:
1- you map each iteration of the loop on a thread. Each time you get a line holding users information. You will end in a thread group with 1500 iterations.
2- you should consider CSVread, which is a little bit more complex, but it allows you to control when to read the next line. Reference here.
Related
I have a CSV file with data, that is dynamic and is changed every test run (it could be 3k or 80+k lines). This data - is uuid, that I extract from CSV and set as a variables to my http requests. HTTP request has DELETE method, so after getting each uuid from CSV file - I can't use it again cause I would have a 404 status code. I've already set up CSV Data Set Config and there is no problems when I do it in 1 thread (Number of Threads (users): 1). But, for proper performance testing I need to run test in multiple threads, i.e. 30 or 50. And the point is - that I don't know how to set up logic to be agile and if I have a CSV file with 50k+ uuids that should be used in one Thread Group that has 30 threads - each thread will take only assigned to him uuids, won't retake them and won't take not assigned to him uuids.
Thanks in advance!
If you're using CSV Data Set Config (and this is what you should be using for 80+k lines file) with default Sharing Mode setting of "All Threads"
each JMeter thread (virtual user) will be taking next line on each iteration which means that each UUID will be used only once no matter how many users are there.
If you additionally set Recycle on EOF to "False" and Stop thread on EOF to "True" your test will be stopped when JMeter reaches the end of the CSV file so no duplicate requests will be sent.
I'm using JMeter. I have a thread group that pulls multiple parameters from a CSV file and makes HTTP requests. I want each request to have 3 seconds in between. I tried to use constant timer, but it sends one request and stops. How can I do this?
My CSV file has 8073 lines. Each line is one request.
This is what my thread group looks like:
Thread Group
CSV Data Set Config
HTTP Request
Save Responses to a File
View Results Tree
If you want delay before each request - add a Constant Timer like:
if you want delay after each request - add Flow Control Action sampler like:
With regards to your "sends one request and stops" behaviour, by default Thread Group makes only one "iteration":
you either need to change this 1 to 8073 or just tick "Infinite" box and configure CSV Data Set Config to stop when it reaches the end of the CSV file:
Make the Thread Group Loop Count Infinite and CSV Data Set Config's Stop thread of EOF true, it'll execute all CSV records
See also option to execute CSV rows in parallel
I have a JMeter work flow where in the script has to perform the below scenario.
There are 130 users and 29000 tasks.
Ideally, 1 user takes approx. 2min to perform 1 task by sending JSON requests.
After completing one task then only, the current user has to pick the other task.
Can you please help me, how to achieve this in the thread group or anything needs to be added here.
Right now, I have added the USER, PASS,TaskID under the PackingTasksCSVConfig
Kindly help me to pass the correct values for the Thread Properties so that, 130 Users can perform 29000 requests accordingly.
In Thread Group:
set "Number of threads" to 130
set "Number of Loopsto 224 (or tickInfinite`)
Supply sufficient data for 29000 requests in the CSV file
In the CSV Data Set Config
configure it to read the file from step 2
if you set number of loops in Thread Group to infinite make sure to set Stop Thread on EOF to True
If JMeter executes actions for performing the tasks in less than 2 minutes you will need to slow it down using Timers or implement Pacing
I am trying to create a jmeter test in which I am taking the http requests and their bodies from the csv file.
I want to run it for 2 users which will fire the http requests mentioned in the csv file 2 times. Which means 2 users will simultaneously start the test, they will fire the http requests mentioned in the csv file once and then will do the same with 2nd iteration. I tried doing it with different settings for Recycle EOF to TRUE/FALSE and Stop thread on EOF to TRUE/FALSE but either it is going in infinite loop or it is firing the requests as . I am definitely missing something here. Any help is appreciated. I am using Jmeter version 5.3
The easiest would be just replacing your While Controller with the Loop Controller with the number of loops equal to the number of lines in the CSV file.
You can determine the number of lines using the following __groovy() function:
${__groovy(new File('c:/full.csv').readLines().size(),)}
In the CSV Data Set Config set "Recycle on EOF" and "Stop thread on EOF" to false
I am learning JMeter and trying to do the following:
0) I only use 1 thread and only 1 loop
1) I have a CSV Data Set Config that loads a file with a bunch of strings (I am required to use CSV Data Set config)
2) I have a http request that responds with a web page. I need to make an assertion to it to verify if every string from the CSV is present on the page
I figured out that JMeter iterates to the next line in CSV file either for each thread or for each thread or loop.
But I only use 1 thread and 1 loop, and I don't want to repeat the whole test plan multiple times to verify if it contains multiple strings (it also does other stuff than this). How do I do this?
The CSV Data Set Config only increments to the next line on the next iteration. If you want access to all(or several) values in the CSV file in the same iteration, you should probably use the __CSVRead() function. Or possibly even the __StringFromFile() function.
If you're just doing this as a one of exercise, you can also put all the values you need to check in 1 CSV line and read them as different columns.
Lastly you can use a while controller to read the next line from CSV Data Set Config as explained here.