Blazemeter only using even records in csv data config - jmeter

I'm using Blazemeter to run my JMeter test scripts to load test it. I've uploaded the jmx file and a csv for the multiple user logins but it only uses those records on even numbered lines lines of the csv. Here is the csv:
60001,TestPass123!
60002,TestPass123!
60003,TestPass123!
60004,TestPass123!
60005,TestPass123!
60006,TestPass123!
60007,TestPass123!
60008,TestPass123!
60009,TestPass123!
60010,TestPass123!
CSV Data Config settings:
File Encoding : (blank)
Variable names : login,password
Delimiter : ,
Allow quoted data? : False
Recycle on EOF: True
Stop thread on EOF? : False
Thread Group Settings (from jmx file):
Number of threads (users) : 1
Ramp up period (secs) : 1
Loop Count : 1
Blazemeter Settings:
Engine(s):Console Only
Server(s):1
JMeter Version:2.11
Thread(s) per engine:10
Rampup:202
Iterations:1
Duration:10m
When I check my results, I only get entries for firms ending in even numbers. Does look like a config setting or a timing issue? When I use the same script file with mulitple logins as above locally, it works fine. When I use the same script with a logins csv that has one entry in it in Blazemeter, it runs fine.
Why is Blazemeter (or JMeter) only picking up alternating records in the csv file?

Related

Execute csv rows, one by one, on all threads

My Test plan has a csv dataset config element, a thread group with a http sampler.
I would like to read first element from csv, run it using 20 threads for 50 iterations, then repeat this sequential process for all the 30 rows of my csv.
I have set the toggle for stop on eof to true.
Most solutions,I have gone through on Stack Overflow, andother blogs, for a suitable solution, suggest adding a loop controller or a while loop, reading the rows using a preprocessor and looping, however, in these cases, I am not able to achieve my objective.
TestPlan
-- User Defined Variables
-- HTTP Request Defaults
-- HTTP Header Manager
-- JSR223 PreProcessor (To get the CSV line count)
-- CSV Data Set Config (Recycle on EOF - False, Stop on EOF - True)
-- Thread Group
-- HTTP Sampler (GET,pass each of the csv dataset element as part of path)
-- View Result Tree
With the above setup, I see that the whole csv is iterated, I inlcuded a loop controller, with loop count, moved the HTTP sampler, under it.
However, when I do this, I was unable to get the usage of Iterations in thread-group.
Article References:
Use same row per thread from a CSV data set in JMeter
How to read each and every row of csv by single user in JMeter?
How to loop each thread with unique data from CSV Data Config file
JMeter - multiple user taking unique row from CSV file
Your requirement is too "exotic", I would recommend creating a new CSV file out of your existing one with:
1st line repeated 100 times (20 threads x 50 iterations)
2nd line repeated 100 times
3rd line repeated 100 times
...
30th line repeated 100 times
If you have problems generating the file you can do this in the runtime, like:
Add setUp Thread Group with 1 thread and 1 loop to your test plan
Add JSR223 Sampler to the Thread Group
Put the following code into "Script" area:
SampleResult.setIgnore()
def generated = new File('/path/to/new/csv/file')
generated.delete()
new File('/path/to/old/csv/file').readLines().each { line ->
1.upto(100, {
generated << line << System.getProperty('line.separator')
})
}
In main Thread Group use CSV Data Set Config "normally", just point it to use the /path/to/new/csv/file
See The Groovy Templates Cheat Sheet for JMeter for more examples of useful Groovy code snippets which you can use to enhance your JMeter tests.

How can run JMeter with limited CSV login details for multiple threads ?

Im just trying to run my JMeter script for 20 threads. I'm use CSV data set config for read login data. I set there are only 5 login details in CSV file. When i run the script only first 5 request got pass and rest of the thread request got fail. Anyone can suggest a solution. Thanks.
Apply the following configuration to your CSV Data Set Config:
Recycle on EOF - True
Stop thread on EOF - False
When JMeter reaches the end of the CSV file it will start over so 6th thread will get <EOF> as the value, 7th thread will pick 1st line, 8th thread will pick 2nd line, etc.
You can put your login request under the IF Controller and use the following condition:
"${line}" != "<EOF>"
to avoid the login failure due to this <EOF> variable value.

jmeter loop through multiple files

I have a Jmeter test with multiple while controler, each looping through data in separate files
I want each while loop to loop through the end of that file.
Structure:
While controller 1
- CSV Data Config 1
- Http sampler 1
While Controller 2
- CSV Data Config 2
- http sampler 2
When I set as an end condition: ${__javaScript(${myVar}!="<EOF>")} with stop thread on end of file to true, it stops the whole test completly.
If I set stop on end of file to false it loops on the also, meaning it loops one time too many
Is there another way to do this?
Thanks
A possible solution would be use beanshell processor and find the number of records in each file. Use the number of lines as the condition to break out of the loop. Please note that you will have to use parseint in the while condition as discussed in this thread.
Another option could be changing your While Controller to do the infinite loop and control thread stopping via CSV Data Set Config.
As per Using CSV DATA SET CONFIG guide:
It is worth mentioning that every CSV Data Set Config is visible to all Thread Groups by default. If you need to use separate CSV Data Set Config for every Thread, you create a number of data files that you need and in every CSV Data Set Config set “Sharing mode” to “Current Thread”
So the following combination:
Recycle on EOF = false
Stop Thread on EOF = true
Sharing mode = Current Thread
Should do the trick for you.

How to do load-testing for 100 concurrent users login with unique username and passwords using Jmeter?

My test plan scenario is to do load-testing for 100 concurrent users login to website.
I have created Threadgroup with Number of threads as 100.
Created CSV file which contains 100 users login details (unique usernames and passwords).
Under Sign in sample added a “User Parameter” from Thread Group -> PreProcessors to it. Added variables using __CSVRead function which reads values from file test.csv.
Selected the login sample and changed the values of userid and password to ${A} and ${B}.
Is this the right way to do or is there any alternative way to achieve this?
If this works for you and works as you expect, that's enough.
But looks like CSV Data Set Config is more suitable and easier to use for multi-user scenarios than __CSVRead function:
Thread Group
Number of Threads: N // count of your test-threads (users)
Loop Count: 1
CSV Data Set Config
Filename: [path to your csv-file with usernames / passwords]
Variable Names: username,pwd // extracted values can be referred as ${username}, ${pwd}
Recycle on EOF? False
Stop thread on EOF? True
Sharing mode: Current thread group
. . .
HTTP Request // your http call
. . .
As per documentation:
The function is not suitable for use with large files, as the entire
file is stored in memory. For larger files, use CSV Data Set Config
element or StringFromFile.
Pretty detailed guides available here:
How to use a CSV file with JMeter
Using CSV DATA SET CONFIG

How to get Jmeter to use CSV data for GET parameters?

I am wanting to achieve the following in JMETER
Jmeter loads CSV file with id numbers
Each user/thread in Jmeter picks a id number and adds it to their HTTP request e.g. http:www.testsite.com/test.php?id=x
Repeat step 2 , selecting the next id number in the file.
This is so I can test that my servlet is performing multiple threads with connection pooling.
I have tried manually entering in values here
However this is not working.
Schema Layout:
Thanks
You can try to implement your schema as below:
1. Prepare your test-IDs in csv-file, e.g. in the following format:
id1
id2
...
idN
2. Use the following schema:
CSV Data Set Config
Filename: [path to your csv-file with test-IDs]
Variable Names: testID // extracted id can be referred as ${testID}
Recycle on EOF? False
Stop thread on EOF? True
Sharing mode: Current thread // this mode allows EACH thread use ALL values from csv
Thread Group
Number of Threads: N // count of your test-threads (users)
Loop Count: Forever
. . .
HTTP Request // your http call
Server Name or IP: www.testsite.com
Path: /test.php?id=${testID} // use variable with extracted ID
. . .

Resources