Endurance testing using Jmeter - jmeter

I am new to Jmeter and trying to understand what all can be achieved using Jmeter. I want to perform endurance or soak testing of a application using Jmeter, i.e. I want to run a particular script for a particluar number of users for a period of 3 hours.
What all options are available to me and what is the best availablelistener to monitor the result?
Please help. Kindly add if I am missing anything that I should know before starting with soak testing?

For setting up the numbers of users and runtime of the test you use a Thread Group. Setting the runtime is done by checking the Scheduler check-box and specifying Duration.
Of the original listeners in JMeter I have found myself most oftenly just using the plain Summary Report. But JMeter Plugins gives additional listeners which may be better, it depends on what you want to measure. The JMeter Plugins also gives additional thread groups, where you can specify e.g. an increasing load over time.

Use a Thread Group to set up your number of users and the duration of your test (using the scheduler of the Thread Group).
Then add all the samplers and logic controllers you need to perform your testing.
Next, add a Summary Report listener to get an overview of your results (min/max/average and such), and add a View Result Tree listener to get an overview of EACH step your testplan is taking. This Tree listener is great to actually see what jmeter is doing, and to debug your tesplan.
BTW: if you add a HTTP Request Defaults object, you can set your URL and options in there, and don't need to add it to each and every sampler again. Especially works like a charm if you start using regexp extractors and such.

Related

How to make several requests be made once? And the rest flow

I have 2 queries and a db connection that i would like to make once as part of testing
CSRF
DB CONNECT
LOGIN
And then comes the API method I need that I'm testing. Here it needs to be run a number of times.
I read the documentation, but I still don't understand. Please help.
Put them under the Once Only Controller, its children are being executed only during the 1st iteration of the Thread Group
I also see a number of Listeners in your Test Plan, when you finish test development and debugging don't forget to remove them as they don't add any value and only consume resources, you should execute your JMeter test plan in command-line non-GUI mode with all listeners disabled or deleted and once it's finished you can use Listeners to analyze the .jtl results file (or just generate HTML Reporting Dashboard from it)

Negative Active Thread Count in JMeter

We're getting negative thread count in JMeter for active threads.
The test plan contains various Http Web Test Plan related components and samplers using Parallel Controller. This is creating problems for us in getting correct metrics as JMeter is emitting the same -ve values to the listeners for active threads. Any insights what might be wrong and how to fix this?
Here's the screenshot from the test plan while executing -
First of all don't run JMeter in GUI mode, it's only for tests development and/or debugging, when it comes to test execution you should run JMeter in command-line non-GUI mode
I don't think you should have Parallel Controller as the first parent sampler, the most obvious use case is simulating AJAX requests, concurrency should be set on Thread Group level

JMeter test report

I'm using JMeter for integration and non-regression testing.
The tests are automated and reports are working.
But since it is scenario testing and not performance testing the report doesn't give real business added value for that kind of tests.
My question: Is there any way to have a scenario (transaction controller based)reporting?
For the moment, to have some more meaningful result, transactions controllers and dummy sampler are used.
What we would like to have is the number of success/failure scenarios of the last test run. And also an history of success/failures per test run (1 by day).
Thank you for your advices.
The easiest way of getting the things done is putting your JMeter test under Jenkins orchestration so it will be automatically executed based on a VCS hook or according to the Schedule
Once done you will be able to utilize Jenkins Performance Plugin which adds test results trends charts and ability to mark build as unstable/failed depending on various criteria.
If I am not wrong, you want to create a suite based on particular test cases. like if single case include execution of more than 1 request in a single execution.
If this is the case, you can simple create a test fragment through jmeter gui, and copy all the samplers in single fragment.
Now to control their execution you can use any controller of your choice, i would suggest you to use module controller for http samplers.

How do I perform a complete Load Test process with JMeter?

I am new to using JMeter and have developed a basic test plan with HTTP Sampler and a few listeners. Please run me through the entire process of how I can start after opening JMeter ?
There's no right answer for this, it depends what you're wanting to achieve. I'd suggest starting with the best practices: http://jmeter.apache.org/usermanual/best-practices.html
And also look at building a web test plan: http://jmeter.apache.org/usermanual/build-web-test-plan.html
I would look at the Graphs Generator listener - https://jmeter-plugins.org/wiki/GraphsGeneratorListener/ - use these graphs to make sure you're making the number of transactions that you would expect in your tests.
Basically - the documentation is your friend. I took time to read what each controller, listener and sampler was doing and decided how to implement these myself. There was some trial and error. JMeter is an easy tool to pick up and use but there's a LOT of depth to it.
In addition to Ali1874 answer, I would suggest looking into how to run JMeter tests using command line. You can find more information at http://jmeter.apache.org/usermanual/get-started.html#non_gui. With regards to reporting JMeter is able to produce nice HTML reports when using -e -o options http://jmeter.apache.org/usermanual/generating-dashboard.html#report_after_load_test.
Also, with regards to Jmeter test plans, in my previous company we used to parameterize number of threads required, servers and other elements. In general structure looked like the one at the example test plan.
We had different user defined variables elements for different environments for faster test tuning. Also, we used bzm – Weighted switch controller (https://github.com/Blazemeter/jmeter-bzm-plugins) to distribute load among endpoints by including HTTP requests from Test Fragment element so that we would not have to duplicate requests allowing to manage them more easily. You can check out full plan at here (https://github.com/gretard/testing/blob/master/00-jmeter/results/samplePlan.jmx). Please bear in mind that test plan uses bzm – Weighted switch controller plugin and jpgc - Standard Set plugin which you can install by using Plugins manager (https://jmeter-plugins.org/wiki/PluginsManager/).
Hope this will help.

Non GUI Jmeter run with Listener

For non-gui JMeter, there is much info available about how to take a report. which is basically done by mentioning report name in command and not adding any listener in Test Plan
But I use a different approach. Please confirm whether it compromises the performance of JMeter or it is as good as mentioned in the 1st paragraph.
I add Listener in Test plan and mention filename in the listener. Do my configure settings. Close the Test plan and run it in NON-GUI mode with the following command.
jmeter -n -t ProjectName.jmx
It is better to use first approach, in which you define the path of report file within your command. It is considered most efficient approach.
An alternative to above is adding 'simple data writer' listener to your test plan. Define the path of report in this listener and run the jmeter script from command line. This is also resource efficient approach. It is similar to your approach. Only difference is that instead of enabling multiple listeners, enable only one listener that is 'simple data writer'. You can later use report generated by this listener in different listeners and generate graphs as required.
To cut it short, resource usage depends upon on choice of listener. Command line mode uses lightest listener by default. If you don't want to mention it in command-line; then enable 'simple data writer' with in your GUI plan. Hope you understand the concept.
I want to use the following Listeners, but as part of my *.jtl file results
View Results Tree
Aggregate Report
jp#gc - Response Times Percentiles
jp#gc - Response Times over Time
Now, since high volume Load Tests run in non-gui mode, so these Listeners have no value. But perhaps they have value when we generate reports after we generate the jtl file. How can that be acheived? Is there some setting in user.properties? Which can enable these listeners? at Report time generation.

Resources