I have this workflow
Login (Once)
Create Orders (in a loop for x mins)
Logout (Once)
Please let me know how can I achieve the below workload in JMeter:
Log in all the users -group 1- (say 10 users ). Keep on creating Orders.
Log in another set of users -group 2- (say 10 users, after 15 mins of the test). Keep on creating orders.
Log out all group 1, [Lets say after 45 mins of the test].
Logout group 2 [At the end of the test, let's say after 1 hr.]
Note: Main focus of the test is to logout the first 10 users and keep the next 10 users running till the end of test.
Edit 1: Removed "Stay Logged in" to avoid confusion. Threads should keep on creating orders until they log out.
What do you mean by "stay logged in"? If user doesn't send any HTTP requests to the server it doesn't produce any load so it doesn't make any sense to "stay logged in" unless it is connected with some network footprint which you need to mimic.
Most probably when you log into the application you're getting a Cookie which has Expires attribute so when you make the next request it checks whether your session is expired and if it's not - you're still "logged in", if it is - you will be redirected to the login page.
If you still want to implement your weird use case you can add a Constant Timer as a child of the Logout request and configure the "sleep" time there.
If there is some background network activity (like some information on the page is refreshed by AJAX requests) the users will need to send these requests periodically and in this case you also need to introduce timers as real users don't hammer application non-stop, they at least need some time to "think" between operations or to simulate periodic polling if they're "idle"
More information: A Comprehensive Guide to Using JMeter Timers
Related
Is it possible to log out a user after a certain amount of time in Sanctum stateful mode? For example the user will be logged out after 4 hours or at the end of the day.
I know that you can set the expiration date for API tokens but I want to log out the user after a certain amount of time in stateful mode (session-based auth).
To clarify, ANY user should be logged out after a certain amount of time. Like you see it in bank applications or other websites with greater security.
In .env you have a variable called SESSION_LIFETIME. That is stored in minutes. Change it in 240 if you want autologout on 4 hours
I am using Gorilla Sessions for my Go website to manage user logins.
Sometimes when a user leaves their computer for an hour or so the session expires but they have no idea about it. So the user goes on with their work but as soon as they try to save their progress, they get logged out. Is there any way I could detect if a user's session is about to expire, so I can automatically save their work or display a warning message?
Solution:
As soon as the client logs in they receive the session expiration date from the server. Then I set up a timer on client side, which after being idle for X (10 in my case) minutes, calls the API in every minute and checks if the session is still alive and if there is more time left than two minutes. If only two minutes left, I raise a warning message on the client side to inform the user that their session is about to expire (I also used this event to fire the auto save functions).
I am using j meter to run the concurrent users.After login the application, I searched the files and finally logout from the application.I don't know to handle the logout process.Currently I created the 100 users.
100 users are logged into the application.
100 users are searched something.
100 users are needed to sign out.
How to do the third step. When I was recording the logout,there is no process are recorded.Could you please tell me the solution.
Usually logout is:
Associated with the relevant HTTP Request
Assumes clearing session data so if you have > 1 Loop on Thread Group level and using one of the following (or both):
HTTP Authorization Manager
HTTP Cookie Manager
Make sure you have Clear xxx on each iteration box checked
Logging out is a call just like any other- and it will be specific to your site. If you closed a browser tab or window, it's possible that you didn't actually log out from your site. It's also possible if you stopped recording too soon that you simply didn't record it.
I suggest manually adding it. You'll have to go into your Browser's Network Debugger to find the actual call that you're looking for, and then recreate it in JMeter.
i am new to jmeter and i am trying to login with 3 different users using the CSV config, but the problem is when i login with second user, the first user gets logged out.
Similarly logging in with third user logs out the second user. How to handle it using jmeter.
I think on any website at a time only one user can logon as the session allows only one.
So if jMeter is trying to logging in by the second user it must be logout the previous one.
1) Add cookie manager
2) Instead of logging all three users in one scenario make looped scenario where first user logs in during the first session, the second one in the second session and so on.
Or you could make three different threads and all the users would connect at the same time with different sessions. But it is more heavy resource-wise.
I have Stepping Load Thread Group which is creating 50 users. I do login once for each user and then I repeat some actions for 1 hour. I have specified in Stepping Load Thread Group to hold load for one hour. I want each user to do logout at the end. I know this is not directly implemented in Jmeter, but I hope you can give me some advice how to build this with other Jmeter components. Thanks
I think we can use Run time controller for your requirement?
Thread Group
Login
Run Time controller (for 1 hour)
- Your repeatable actions
Logout