JMeter test simultaneous users with sequential requests - performance

I have a problem. I would like to do sequential http request with JMeter but with simultaneous users.
Example : I've got 100 users and at the same time they try to do :
Login
Do stuff 1
Do stuff 2
Logout
In this order.
In my results I don't want to have
User 1 do :
login
stuff 1
stuff 2
logout
after that the
user 2 login
stuff 1
stuff 2
logout
I would like to have at the same time User 1 and 2 try to login after that they do their stuff and logout.
So, in my results I can have this example :
Login user 1
Login user 2
Stuff 1 user 1
Stuff 2 user 1
Stuff 1 user 2
Stuff 2 user 2
Logout user 2
Logout user 1
Thanks,
Marcel

Take a look at Synchronizing Timer, I believe it is exactly what you need.

Related

How to Control Time Expires of a 1 session in Classic ASP?

I have 3 sessions -
1- USER
2- LANGUAGE
3- COUNTRY
When session expires - user is redirect to login and receive a message: "You are disconnected by inactivity"
Its ok. but..
MY ISSUE:
Because I lost session - I lost ALL 3 Sessions - and I don't know the LANGUAGE and COUNTRY of the user.
Then I Always print an English alert (default language)
What I want:
A way to control de timeout of each session. With this I can expires User Session first - and get the other two parameters to print the right language.
Is it possible?
I know how to expires - but ALL sessions..
tks!
Use cookies, so you can control the time, even if the user closes the browser
Response.Cookies("name_cookie")("language") = 1
Response.Cookies("name_cookie")("country") = 1
Response.Cookies("name_cookie").Expires = now + 365

4 thread groups in 1 test plan login time for 100 threads in all thread groups

I have included 4 Thread groups in one test plan and recorded script for all thread groups . As all ALL thread groups contain login script , so can i record time for first request of login from all the thread groups ? and then another 4 users entering system and login again and time is recorded -> this i have to do for 100 threads :::: first 4 users come then other 4 come and perform login .please tell if anyone could solve my issue .
If I got your scenario right you need to go for the following configuration:
Thread Group (Number of Threads: 4, Loop Count: 25)
HTTP Request sampler which performs login
Synchronizing Timer (Number of Simulated Users to Group By: 4)
This way you will have 100 requests in total, there will be 25 "login" loops when 4 virtual users will perform login at exactly the same moment.

Jmeter user session wise different data set

My test plan is as following
- Test Plan
- Thread Group (No of Threads: 4)
- HTTP Request Defaults
- HTTP Cookie Manager
- CSV Data Set Config(Login Information) [4 user login]
- Simple Controller
- HTTP Request(GET: Open Login Page)
- HTTP Request(POST: Login auth)
- Loop Controller
- CSV Data Set Config(Operation Information) [8 operation data]
- HTTP Request(GET: Open Operation page)
- HTTP Request(POST: Commit Operation)
- HTTP Request(POST: Logout)
In this plan suppose I provide 4 users and 8 operation data.
What it doing is running 8 operation for 4 users each in total of 8x4=32 operations.
How could I make this as following
1st user will do 2 operations
2nd user will do 2 operations
3rd user will do 2 operations
4th user will do 2 operations
I want to provide user session wise different operations that 4 users will do number of transactions but the transactions will not be same.
How can I achieve this?
If I'm getting your test scenario correctly you can just set the "Sharing Mode" of your CSV Data Set Config (Operation Information) to Current Thread Group.
Current thread group - each file is opened once for each thread group in which the element appears
If you want more precise control I believe Switch Controller is what you're looking for, using it you can select which user will go for which execution branch.
See Running JMeter Samplers with Defined Percentage Probability article for more information.
As requested, I am posting my solution. Below is the test plan story.
Test Plan
Thread Group
I used only 1 thread in my thread group and 4 in the loop count as shown below.
Loop Controller
CSV Config for the both the files
Output

Webapp2 and disappearing session after POST request

Appengine 1.7.4, webapp2, sessions.
Sessions are configured as shown in documentation: http://webapp-improved.appspot.com/api/webapp2_extras/sessions.html#webapp2_extras.sessions.SessionStore
# Some object
def post(self):
logging.error(self.session.get('cart')) #A 1 item
if '_put' in self.request.params:
return self.put()
cart = self.session.get('cart')
# add one item to cart
self.session['cart'] = cart
logging.error(self.session.get('cart')) #B OK, 2 items
return self.redirect(URL)
def put(self):
logging.error(self.session.get('cart')) #C 1 item?!
# some code
return self.redirect(URL)
Two POST request send by AJAX.
First without _put
- #A - returns 1 item - OK.
- #B - returns 2 items - OK.
Second, POST with _put.
- #A - returns 1 item - why? session was changed?
- #C - as above
Requests are executed one by one (user clicks once, two requests). Any ideas why this might be happening?
If I run only the first request (without _put) and refresh page - session is saved correctly.
Problem started after the migration from the webapp (1.x) and Python 2.5.
Thanks for any suggestions.
How much time is between these two requests? Less then 1 or 2 seconds? Then you might have a race-condition here:
Req. 1 reads the session
Req. 2 reads the session
Req. 1 saves its session
Req. 2 saves its session
==> Changes from Req. 1 are lost. Please note that (due to the distributed architecture of the appengine) "saving" can occur even after the request itself has finished!

JMeter: How to make the referer field dynamic based on the situation

Apart from the Home page Suppose there are 2 pages i.e page A ,Page B , first step user have to login, then if that user have the permission to view page Page A ,Page B then he can go to those page else on clicking those page name from the top navigational bar user will remain in the home page.
1 login
2 Home [If Login Successful]
|
Check if have permission to view --------- Logout
|Yes
2 Page A
|
Check if have permission to view Page B --------- Logout
|Yes
3 Page B
|
4 logout
Suppose there are 3 users ,i.e user 1 , user 2 and user 3. Now User 1 have the permission to view both page A , page B but user 2 have the permission to view only page A and user 3 do not have the permission to view any of this two pages.
i have used assertion under the page A sampler , page B sampler to check weather correct threads are accessing this pages or not that is system is allowing only the authorized person or not.
in the thread group i have opted if error occur then " stop thread " , thats why if any thread fail to assert then it is not getting counted in the future , thats why in the logout sampler only 1 thread is showing, and that thread is for user 1 because this user have the permission to view both page A ,B . and user 2 and 3 are not considered as they have fail assertion in the previous stages. so is there any way out that in the logout page i can send all those thread which have cleared the login section successfully irrespective of there view page permission.
so at the time of logout in the logout page for user 1 in the referrer field it will show the link of page b but for user 2 at the logout page referrer field value will show the link of Page A. and for user 3 it will be home page.
so can any one please tell me how the referrer field value can be change dynamically based on user permission in the logout page .
This is a possible scenario, as I don't know how you are checking the permissions of the logged users.
HTTP Request - Login
Regular Expression Tester - capture an expected value to validate login
If Controller - If Login OK
HTTP Request - Home
Regular Expression Tester - Referrer to Home (Headers option maybe)
HTTP Request - Page A Permission Verifier
Regular Expression Tester - extract permission validation value
If Controller - If user has permission to Page A
HTTP Request - Page A
Regular Expression Tester - Referrer to Page A (Headers option maybe)
HTTP Request - Page B Permission Verifier
Regular Expression Tester - extract permission validation value
If Controller - If user has permission to Page B
HTTP Request - Page B
Regular Expression Tester - Referrer to Page B (Headers option maybe)
Http Request - Logout
HTTP Header Manager - Referrer: ${referrer}

Resources