Problem with Mutiple CSV Data Set config in jmeter - csv

Below is my Test plan to read Data from Multiple CSV file. I wants to test Scenario like
1. 10 users performed operation on 100 documents. Idealy each user should get 10 documents and perfromed the operation on it.
TestPlan
Thread Group
While controller
LoginUserDataConfig
LoginRequestRecordingController
HTTPLoginRequest
DocumentOperationRecordingController
DocIDList
HttpSaveRequest
But with above plan It is taking only 10 document and stop the process. I run the script by changing CSVDataConfigu setting like Shared Mode to All Thread\Current Thread but not getting desired output.
Can any one correct my test plan.
Thread Settings:
Number of Thread: 10
Ramp-Up Period: 2
loop count: 1
LoginUserDataConfig Settings:
Allowed Quoted Data: False
Recycle on EOF? False
Stop Thread on EOF: True
Sharing mode: Current Thread Group
DocIDList Settings:
Allowed Quoted Data: False
Recycle on EOF? False
Stop Thread on EOF: True
Sharing mode: Current Thread Group

You should mark loop count as forever and it will continue until End Of File of CSV (100 IDs)

Related

How to call soap service about a millon times from JMeter using data from a CSV file

I have to take inputs from a CSV file which has a comma separated single line of million 6 character strings. I need to read these one by one and run the JMeter SOAP post query by attaching these values
What I need to know is how to configure this csv file to read data one by one and pass it to the SOAP query. I tried adding a CSV option with a while controller in JMeter. But doesnt seem to work. I need to know the condition in the while controller as well.
Consider using following Test Plan configuration:
Test Plan
Thread Group
While Controller
Counter
SOAP Post Query
CSV Data Set Config
Relevant configuration:
While Controller
Condition: ${__javaScript(${N}<1000000)}
Counter
Start: 1
Increment: 1
Maximum: 1000000
Reference Name: N
SOAP/XML-RPC Request
everything as per your current use case
CSV Data Set Config
Recycle on EOF: true
Stop thread on EOF: false
For my scenario, it didn't require any while controller.
I've done following Test Plan configuration with JMeter 2.9 & JDK 1.6:
Test Plan
Thread Group
SOAP/XML-RPC Request
CSV Data Set Config
Thread Group:
Number of Threads: <as per your requirement>
Ramp-Up Period (in seconds): <as per your requirement>
Loop Count: 1
SOAP/XML-RPC Request:
URL: http://<The WSDL of your web service>?wsdl
Send SOAPAction: <name of action to be performed>
Soap/XML-RPC Data:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:fac="<your URL>">
<soapenv:Header/>
<soapenv:Body>
<fac:abc>
<arg0>
<var1>${var1}</var1>
<var2>${var2}</var2>
</arg0>
</fac:abc>
</soapenv:Body>
</soapenv:Envelope>
CSV Data Set Config:
Filename: xyz.csv
Variable Names (comma-delimited): var1,var2
Delimiter: ,
Stop Thread on EOF: True
Sharing mode: All threads
Other parameters as per your requirement.
CSV file should be in the same folder where you have saved Test Plan. Otherwise, you need to specify relative path.
xyz.csv:
123,456
789,111
222,333

How to format output from a program spawned from a expect script

I am writing a load testing script for radius server using tcl and expect.
I am invoking radclient, that comes inbuild with the radius server, from my script on remote server.
scripts does following:
take remote server IP
- spawn ssh to remote server
- invoke radclient
- perform load test using radclient commands
- need to collect the result from the output (as shown in the sample output) into a variable
- Extract authentication/sec as Transaction per second (TPS) from output or variable from previous step
Need help on last two steps:
Sample output from radclient:
*--> timetest 20 10 2 1 1
Cycles: 10, Repetitions: 2, Requests per Cycle: 10
Starting User Number: 1, Increment: 1
Current Repetition Number=1
Skipping Accounting On Request
Total Requests=100, Total Responses=100, Total Accepts=0 Total Not Accepts=100
1: Sending 100 requests and getting 100 responses took 449ms, or 0.00 authentications/sec
Current Repetition Number=2
Skipping Accounting On Request
Total Requests=100, Total Responses=100, Total Accepts=0 Total Not Accepts=100
2: Sending 100 requests and getting 100 responses took 471ms, or 0.00 authentications/sec
Expected Output:
TPS achieved = 0
You might use something like this:
expect -re {([\d.]+) authentications/sec}
set authPerSec $expect_out(1,string)
puts "TPS achieved = $authPerSec"
However, that's not to say that the information extracted is the right information. For example, when run against your test data it is likely to come unstuck as there are two places where you have authentications/sec due to all the repetitions; we don't account for that at all! More complex patterns might extract more information and so on.
expect {
-re {([\d.]+) authentications/sec} {
set authPerSec $expect_out(1,string)
puts "TPS achieved #[incr count] = $authPerSec"
exp_continue
}
"bash$" {
# System prompt means stop expecting; tune for what you've got...
}
}
Doing the right thing can be complex sometimes…

How to trigger an OpenNMS event with thresholds

it seems that it is not possible for me to trigger an event in OpenNMS using a threshold...
first the fact (as much detail as i can)
i want to monitor a html file, better, the content.
if a value is not what i expected OpenNMS should call be.
my html file:
Document Count: 5
in /var/lib/opennms/rrd/snmp/NODE are two files named: "documentCount" (.jbr & .meta)
--> because of the http-datacollection-config.xml
in my logfiles is written:
INFO [LegacyScheduler-Thread-2-of-50] RrdUtils: updateRRD: updating RRD file /var/lib/opennms/rrd/snmp/21/documentCount.jrb with values '1385031023:5'"
so the "5" is collected correctly.
now i created a threshold for this case:
<threshold type="high" ds-type="node"
value="4.0" rearm="2.0" trigger="1" triggeredUEI="uei.opennms.org/threshold/highThresholdExceeded"
filterOperator="or" ds-name="documentCount"
/>
in my collectd-configuration.xml is the threshold also enabled:
in my opinion the threshold of 4 is exceeded, because the value is 5. so the highTresholdEvent should be fired. BUT IT DOESNT.
so i'm here to ask if someone had an idea.
regards dawn
Check collectd.log with the following
tail -f collectd.log | grep -i thresholding
Threshold checking was moved to evaluate while the data is being retrieved a while back as opposed to a post process of rrd files.
Even with the log setting at info you should find some clues as to why the threshold rule is not matching any data.

How to send JSON data from csv file in POST method?

In my project I am using Jmeter for load testing.
I have created a test plan as follows:
Login to the application using a csv file which has 10 unique username and password (successfully done)
A regular expression extractor will get the session id from the response which will be used in the next sampler for submitting a request. (sessionId extracted successfully)
The next sampler will submit a request. This sampler accepts two parameters: sessionId & licenseRequest. A little details for the java-script is as follows:
url: "groovy/enqueue",
type: "POST",
global: false,
data: {sessionId: uSessionId, licenseRequest: JSON.stringify(requestJSON) },
dataType: "text",
For submitting the request I have created a csv file.
The csv is similar like this:
Entry 1:
{"activations":["<activation-code>","<activation-code>"],"email":"<emailIdofUser>","csvEntries":[{"model":"<modelname>","serial":"<serialNo>"}],"comment":"testing jmeter"}
What I have found out that while submitting the request in th second sampler the post request is malformed:
POST data:
sessionId=vZNjFjW38cid&licenseRequest=%3CEOF%3E
As you can see the licenseRequest's value is not correct. It is sending the EOF, which is not desired.
Ensure that you have the CSV Data Set Recycle on EOF and Stop Thread on EOF values correctly:
if you plan to iterate over the file more than once you must set Recycle on EOF = True (i.e. instruct jmeter to move back to the top of the CSV file);
set Stop Thread on EOF = False if you are using a loop controller, Stop Thread on EOF = True if you are using a while controller and want to stop after reading the whole csv dataset;
in case if you need that each of N threads reads and uses single and unique line from csv-file you have to set Sharing mode: Current thread group for CSV Data Set Config (number of csv-entries should be in this case the same as threads number, or Recycle on EOF? False should be set otherwise);
in case if you need that each of N threads reads and uses all lines from csv-file you have to set Sharing mode: Current thread for CSV Data Set Config.
Don't forget to look into jmeter.log or use Log Viewer to detect any issues with csv usage.
The simplest case is like the following:
Test Group
Number of Threads = 10
CSV Data Set Config (User Logins)
Filename: ... (your csv-file should have 10 entries)
Recycle on EOF = False
Stop Thread on EOF = True
Sharing Mode = All threads
CSV Data Set Config (License Request)
Filename: ... (your csv-file should have 10 entries)
Recycle on EOF = False
Stop Thread on EOF = True
Sharing Mode = All threads
Login Sampler
License request Sampler
This will produce 10 threads each with separate login-entry and license-request-entry from csv's.

JMeter CSV Looping

Can anyone tell me how I can loop over the same CSV file twice without having to stop the thread?
Currently I have
Thread Group
+-- While Controller
+-- CSV (True,True,False)
Loop Controller (2)
+-- SOAP/RPC Request
So the idea is to retrieve 5 requests and then repeat the same 5 request again.
NOTE: i do not want to send the same request twice.
Assuming your question means: "I want to reuse the data set, but do not want to send the same request concurrently.", then you should be able to set up the following configuration. You shouldn't need a while loop.
Thread Group
* Loop Count = 2
* Thread Count = 5
|
+-- CSV
* Recycle on EOF = true
* Stop thread on EOF = false
* Sharing mode = All threads
To break that down:
The Loop count on the Thread Group will run the entire thread group the specified number of times, with 5 threads, each one of which will make one request from your CSV file
The "Recycle" and "Stop thread" settings on the CSV Data Set config will cause the data set to be reused until the threads have completed.
Another way of accomplishing this is to set up a loop count as a multiple of the number of URLs you are going to sample:
Thread Group
* Loop Count = 10
* Thread Count = 1
|
+-- CSV
* Recycle on EOF = true
* Stop thread on EOF = false
* Sharing mode = All threads
That's slightly less efficient, since it means the requests have to execute serially rather than in parallel threads, but it is another way of doing it.