While running ultimate thread group with multiple users in parallel, I'm getting 'Session Expired' message for the application - jmeter

Please find below details,
Ultimate Thread Group: User:10, Initial Delay:0, Startup time:300, Hold time: 900,Shutdown time: 120
Once Only Controller: Login
Run Time Controller: Actions (Given Seconds: 1420)
Once Only Controller: Logout
If I run the group with single user it's executing the Login and Action sampler without any error But logout sampler is not executed.
If I run the group with multiple user, some of the samplers are passed and some of the samplers are getting fail with error message as 'Session Expired'. Here also Logout sampler not executed.
How to over come this issue in Jmeter?

The Logout sampler is not executed because the thread is shut down before it reaches it. Your overall thread group duration is 1320 and your Runtime Controller is set to 1420
With regards to the "Session Expired" I can think of 2 options:
missing or improperly implemented correlation, i.e. the maximum duration of the user session is shorter than your test duration. Have you added HTTP Cookie Manager to your Test Plan?
your application gets overloaded and cannot properly maintain the user session, check its logs for any suspicious entries.

Related

JMeter web page test - Your session expired because of inactivity

There will be two actions once we click on log in button
login page action
dashboard action
Part of JMeter
login page action got success.in the continuation
dash board action got failed saying
"text":"Your session expired.","explanation":"Your session expired because of inactivity."
Can anyone help me please..
Your SUT is likely to have some form of verification mechanism which checks user session by verifying parameter(s).
Well-behaved test should do exactly what real browser does, to wit:
Open login page
Perform login
Open dashboard
and your job is to ensure that requests which are being triggered by JMeter are 100% match to the requests which are being sent by the real browser.
Try adding HTTP Cookie Manager to your Test Plan, if your SUT checks the cookie - that should be enough. If not - most probably you will need to perform correlation - the process of extracting dynamic parameters from previous response using JMeter Post-Processors, saving them into JMeter Variables and replacing hard-coded (recorded) values with these variables.

Running Jmeter for Https app with single user for multiple times through Loop controller

Attached is the snapI am trying to run jmeter for single user with value of 10 in loop controller , I first login into the app and then subsequently uses the CSRF token accordingly for future request .The login is always successful and generates CSRF token, But when i try to use CSRF token for future request , I get unauthorized HTTP 401 reponse code , when running with value 10 in loop controller for single user , the same works when i try to run single user with value 1 in loop controller , Any idea how to fix this? (Note :- All this is present in same thread Group)
Well-behaved JMeter test should be able to loop single user without any problem, most likely you have a problem with your test design or mismatch with the application under test behaviour. General recommendation would look like:
First of all switch to iterations on Thread Group level, JMeter configuration elements don't respect iterations originated from elsewhere as "iterations"
Add Debug Sampler and View Results Tree listener to your Test Plan
Run your test with 1 user and 2 loops
Inspect request and response details, identify missing/extra/different parameters and fix them. See How to Debug your Apache JMeter Script for more details on JMeter test troubleshooting techniques.
Blind shot: your test includes login request and the virtual user is already logged in therefore it doesn't require login on 2nd loop. In this case you have 2 options:
Put the logic which needs to be executed only 1 time under Once Only Controller
If you use HTTP Cookie Manager be aware that Clear cookies each iteration works only on Thread Group-level iterations

Concurrent thread group execution on same application is failing few sampler in jmeter

I am rookie to Jmeter.
I have been asked to run multiple thread groups where there is a single Testplan.
All these Thread groups perform different scenarios on same application.
but running them concurrently is failing few samplers, on the other hand if i run them sequentially then everything works well.
so can anyone guide me on this as what can be done.
Details:
there are 3 samplers.
1. Login with post form
2. Get case status page
3. Logout
Unique key generated from Login page response is RANDOM_TOKEN_KEY which I am capturing and passing it to "Get case status page".
JsessionID is getting generated uniquely for individual steps hence i have skip that one.
From case status page I am directly clicking on Logout page which is working fine.
Issue: when this test is triggered for more than 1 threads, example 10 at same time. then Login is working fine but "Get case status page" sample is throwing error as "Your current session has expired. Please log in again."
Script failed when run concurrently with same user credentials
You should check the checkbox "Delay Thread creation until needed" in Thread Group.
This way threads will work without interrupting the flow.

Scheduling Login, post request and logout in Jmeter

I have Test Plan in Jmeter having following three sections:
Login (HTTP Sampler)
Runtime Controller (Containing HTTP POST Requests)
Logout (HTTP Sampler)
I want to schedule the test in following way:
300 users LOGIN
Once all the users are logged in, the Runtime Controller runs for 1 hour posting HTTP Post request
All the 300 users logout.
I have set the Thread group to 300 users, and Runtime controller duration to 3600 seconds. But I have observed that the Login, POST requests and Logout are not synchronized the way I want it to be.
I am new to Jmeter, please help!
You need Synchronizing Timer to achieve 300 users doing same activity concurrently.
Synchronizing timer blocks or holds the threads at a point till x no. of threads are blocked. It then releases all blocked threads at once so that peak concurrent load (300 users doing post activity at a time) is achieved.
you should follow below sequence,
Please change Number of Simulated Users to group by to 300 i.e your needed users.

JMeter page response is not complete or empty, what to do?

I'm running my JMeter scripts for only 5 virtual users. The scenario is: each user logs in to a system using credentials, checks some boxes and clicks the submit button. For the first 4 users, it works fine. I could see the successful submit button response. But often time for the last user, it seems the response page is not complete, though there's no errors.
Can anyone please tell me how can I ensure a complete page response? I'm attaching a screenshot if that helps.
Thanks!
--Ishti
With the listener on the thread where the request is sent, you might find the thread has been terminated before the response has been consumed.
You have another results tree listener at global scope, does it show the response?
Check jmeter.log to determine the time the thread ended.
Try adding a post-processor to force the thread to wait for response.

Resources