Recording application using template - jmeter

I have recorded my web application through template & just to confirm that load test result which i am getting is correct? Just by increasing No of users does it give proper results? Is it enough for load testing of web application?

First of all you need to ensure that your test does what it is supposed to be doing. Recorded tests can rarely be successfully replayed, so normally you should be acting as follows:
Add View Results Tree listener and run your test with 1 user. Inspect request and response details to verify your test steps.
Perform correlation and parametrization if required.
Correlation: the process of identifying and handling any dynamic parameters. Most often people use Regular Expression Extractor for it.
Parametrization: the process of making your test data driven. For example, if your application assumes multiple authenticated users you need to store the credentials somewhere. Most commonly used test element for this is CSV Data Set Config
Make your test realistic. Virtual users simulated by JMeter need to represent real users using real browsers as close as possible with all the related stuff: cookies, headers, cache, etc. See How To Make JMeter Behave More Like A Real Browser to learn how to configure JMeter to act closer to real users. Also real users need some time to "think" between operations so make sure you are using Timers to simulate this behaviour as well.
Only after you apply the above points you should add more virtual users. Again, run your test with 2-3 users and iterations to ensure your test funcitons as designed. Once you are happy with it you can increase the load, but don't overkill your server, increase the load gradually and check the impact of the increasing load on your application, i.e. how response time, throughput and number of errors change as you increase the load. The same is applicable for decreasing the load, don't turn it off at once, decrease the number of virtual users gradually.
Building a Web Test Plan
Building an Advanced Web Test Plan

Related

How to create proper JMeter workload model

How to create proper workload model in JMeter if I have only number of concurrent users and response time as input/requirement? Do I need any additional information in order to load test app?
If these are only info I can get, how to approach load testing in context of using JMeter as load testing tool, any ideas - suggestions - advices?
A "proper workload" would be simulating real life usage of the system under test by "the number of concurrent users".
Just replicate real user behaviour at HTTP protocol level paying attention to pretty much everything i.e.
JMeter's network footprint must be exact replica of the browser's network footprint when it comes to HTTP requests so cross-check the number and the nature of the requests from browser developer tools and JMeter's View Results Tree listener
Make sure to send the same/proper HTTP Headers
As a subset of point 2 pay attention to Cookies
Make sure to download embedded resources like browser does
In addition to point 4 make sure to properly handle cache
Use Timers wisely to simulate think times
If your users are doing different actions configure your JMeter test to distribute them like real users are distributed
Once done just run your test with the anticipated amount of users for the desired duration and compare the real response time against the anticipated
The Avg RT and other KPIs (such as Throughput) are the result of generating or executing the workload with a determined # of VUsers. IMO, the best approach is to generate the load by varying the VUsers as shown in the graph:
This graph also shows a key concept: perfomance (as measure by KPIs) is not linear (although it might appear linear at a small # of VUsers).

Is there a specific way to achieve the below scenarios in JMeter ? if yes how?

Can someone guide how can I achieve below scenarios via JMeter
1.Check if system is able to process 1,00,000 random searches per hour
2.Check if system can accept 1,00,000 transaction's per minute- this is more like form submissions
First of all you need to implement your test scenarios (search and submitting forms) using HTTP Request samplers
The HTTP Request samplers can be:
Recorded using JMeter's HTTP(S) Test Script Recorder
Recorded using JMeter Chrome Extension
Created manually basing on your application/endpoint specifications
Once you have test project skeleton and perform necessary correlation of dynamic values and parameterization of dynamic parameters like usernames you can start defining the workload, i.e. see Building a Web Test Plan user manual chapter
Add as many virtual users as needed, run your test and see whether your application can handle the anticipated load.
Suggested scenario:
Increase the load gradually, i.e. start with 1 user and increment the number of users till the projected amount
Look at Transactions per Second chart and Active Threads Over Time chart. On well-behaved system the throughput (number of requests per second) should increase as the number of users increase.
If you detect the point when you increase the load but the throughput doesn't increase - it means that the system reached the maximum performance. If it is sufficient - you can report the test as passed, otherwise you will need to investigate the root cause and either report or fix it if you're capable of doing this.

I am not able to record place order activity and perform load testing on randomly generated URL

at the time of recording activity I am recording complete activity till place order, but when run the same action for 5 times, in result everytime its hitting same URL that has been generated while recording, but because of it place order not recording to my admin account.
In the majority of cases unfortunately you will not be able to successfully replay the recorded script because modern web applications widely use dynamic parameters for various reasons like client side state tracking or security reasons.
So you need to parameterize and/or correlate your test and replace recorded hard-coded values with either dynamic parameters which needs to be extracted from the previous response using a suitable JMeter Post-Processor or provide random values or use pre-defined values from i.e. external CSV file.
The easiest way of detecting dynamic parameters is recording your test one more time and comparing 2 recorded script - the parameters which will differ will require your attention.
You can also consider using an alternative recording solution which is capable of exporting recorded scripts in "SmartJMX" mode with automatic detection and correlation of the dynamic values, check out How to Cut Your JMeter Scripting Time by 80% article for more details.

I want to know how many request per second my server can handle?

I want to know how many HTTP requests per second my server can handle using Jmeter.
I got throughput 128/mins which means 2/3 req per sec. but something is wrong in my sampler can you tell what I need to do to test the login URL?
Hammering a login page doesn't have anything in common with the load testing as load testing is checking your application against the anticipated load.
If you're trying to determine the maximum number of requests per second your server can handle - this is some form of stress testing
In both cases you should come up with a realistic test scenario which would represent real users using real browsers like:
Record your scenario using JMeter's HTTP(S) Test Script Recorder
Perform parameterization and correlation
Run your test with several virtual users/iterations and inspect request/response details using View Results Tree listener to ensure that your test is doing what it is supposed to be doing
Once you're happy with your test script - disable the View Results Tree listener and run full load test using command-line non-GUI mode
Analyze your results using JMeter Reporting Dashboard
With regards to your goal I would recommend increasing the load gradually so you would be able to correlate the increasing number of users with the increasing throughput.
When you reach the point where you're adding more users and the throughput doesn't increase - it means that the application cannot handle more load hence that would be the maximum number of users/requests per second your application can handle.

Visual Studio Web Test - Recording background requests

I have a web test where my requirements need a handful of different polling requests to be going on in the background. I have created a WebTestPlugin that looks for a certain context parameter to be set, and once it is, it kicks off a thread that just loops (every X seconds) firing off the configured request.
My issue is that this is not done in the context of the test, therefore the results (# of calls, duration, etc) is not part of the final report.
Is there a way to insert this data?
Rather than starting your own thread to run the background requests I suggest using the facilities of the load test. That way the results will be properly recorded. Another reason is that the threading regime of a load test is not specified by Microsoft and adding your own thread may cause issues.
You could have one scenario for the main test. Another scenario has one or more simple tests for the background polling activity. These tests could be set with a "think time between iterations" or with "test mix based on user pace" to achieve the required background rate. To get the background web tests starting at the correct time start the test with a constant load of 0 (zero) users and use a load test plugin that adjusts the number of users whenever needed. The plugin writes the required number into m_loadTest.Scenarios[N].CurrentLoad for a suitable N. This would probably be done in the Heartbeat plugin but potentially could be in any load test plugin. If may be that the TestFinished plugin can better detect when the number of users should increase.

Resources