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
Related
I have an online order site. How to Load test with 100 new users order a product at the same time using JMeter(not one user after another. Order with 100 users at the same time).
For order submitting user has to go multiple pages like as Menu > Checkout > Basket > Your Details with email & password > Payment > Confirmation page. I have tried it by BlazeMeter recorder tools for 1 user order process and then save as a JMX file and then import it on Jmeter. Finally unable to get a solution. I have passed 2-3 days did not get a solution. Could you please advise?
First of all make sure that the test works fine for 1 user as record-and-replay in the majority of cases won't produce a valid script due to dynamic parameters which need to be correlated (at least add HTTP Cookie Manager to your Test Plan to automatically handle Cookie-related headers). So inspect each request and response details using View Results Tree listener and amend your test so each request will give the anticipated result up to the payment confirmation page.
Once you will be able to run test successfully several times with 1 user you will need to get the list of 100 username/password combinations and save it into a CSV file. Then add CSV Data Set Config to read the credentials from the file and replace recorded hard-coded username and password with the JMeter Variables from the CSV file
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
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.
Yesterday, I started to write my first test cases with JMeter. Everything worked fine, but my test plan is growing and becomes messy. My problem is that I have a complicated login process with multiple HTTP calls which I need to do before each of my tests. The best way to re-use this login functionality I found so far is this:
I have a thread group (called Do the SAML Login) which is disabled. It contains two controllers which encapsulate the login and logout. Under that I have multiple thread groups for the actual tests (the screenshot only shows the first one). Each thread group starts and ends with an Once Only Controller to do the login and logout respectively. Between them are my actual test calls.
My problem is the following: I can execute my tests in a loop and all calls between my Once Only Controllers are executed multiple times while the login and logout is executed only once (cool!). But when I run with multiple threads, the login/logout is also done multiple times in threads.
How can I prevent this? I think I'm looking for some setup-up and tear-down method for my thread groups, but I don't know how to do it with JMeter.
I would suggest moving your login and logout logic into setUp Thread Group and tearDown Thread Group correspondingly
You can use Test Fragments in combination with the Module Controller to re-use your login/logout login in multiple test plans.