JMeter - Once Only Controller for Authentication with Stepping Thread Group - jmeter

I have been using a plain old vanilla Thread Group in JMeter for a while now, using a Once Only Controller to authenticate each thread before accessing the page in my app I wish to profile.
This has been working perfectly. However I now want to try using a Stepping Thread Group with my app so I tried this same approach but it's not working - when I look at the results of the main request for the page I am trying to profile, I can see it's instead redirecting to the login screen, since the thread is not logged in.
I then got rid of the Once Only Controller and tried to simply have 2 requests under the Stepping Thread Group - first one to simply login, then a separate request to hit my app page to profile. However I'm running into the same issue (even though it does appear the login request is being executed - I'm seeing correct responses and activity there in the View Results listener, so maybe it's just not happening in the correct order?).
Sorry if I'm missing something, I'm still relatively new to JMeter. Any help or guidance greatly appreciated. Thanks!

Turns out I was missing an HTTP Cookie Manager. Though interestingly some of the responses for the page I wish to profile are coming back to the Login page as unauthenticated but most are making it through now.

Related

How can I resolve active session problem in JMeter

Whenever I run the login/logout script, I get You have already logged in. How to resolve this?.
when I try to login manually. I got this popup message.
This user is already logged in. Do you want to terminate other active session.
So, how to handle this situation in JMETER.
enter image description here
Please implement the logout request and after that clean the cookie.
Follow the instruction as mentioned in
Jmeter Clear cookies after each http request
It means that logout doesn't really logs you out, not knowing the details of your test/application it's not possible to come up with a comprehensive solution, in the meantime you can try unticking Same user on each iteration on Thread Group level:
or ticking Clear cookies each iteration box in the HTTP Cookie Manager/HTTP Cache Manager
If your session is being orchestrated by a custom Header - remove it from the HTTP Header Manager somehow

Make a request handle redirect by providing necessary parameters

I'm using jmeter to load test a Feature Page.
My jmeter requests (for that page) are being redirected to a login page. How do I provide login info for that redirect?
I already tried:
Controller
Login Page
Feature Page
Logout
But somehow a user even though already authenticated via Login Page is still being asked to login on the Feature Page.
Wondering if someone has a suggestion.
Make sure you're really logged in as "green" result in JMeter doesn't necessarily indicates successful request. You can verify responses using View Results Tree
listener
Add HTTP Cookie Manager to your Test Plan, if your application uses cookies for establishing/maintaining user session it should automatically resolve your problem
Inspect your test plan for any dynamic values (request parameters, headers, URL postfixes, etc.), if the are - they need to be correlated.

Session time out notification

My web-application developed on Vaadin - Servlet using Tomcat server.
When user clicks logout link, session timeout error is coming and then after some time it is automatically redirecting to login page.
Previously the redirection was so fast that user was unable to see this timeout error.
But now after some version update in Vaadin, user is able to see this error.
Suggest a way to resolve this issue.
I am thinking of finding a way to stop the browser from showing the error message for session-timeout , when the session is timed out using logout button.
How to achieve it. Or is there a better solution you can suggest?
Thanks in advance.
Before invalidating the session disabling the Push Mode.
Page.getCurrent().setLocation(location);
UI.getCurrent().getPushConfiguration().setPushMode(PushMode.DISABLED);
session.getSession().invalidate();
This will work fine.
The problem comes because support for Push is not fully implemented by all servers. So on some servers this problem may not arise.
With above logic you can also set Transport.LONG_POLLING which works fine for all servers.

Login to liferay using jmeter

After lot of problems i finally got liferay sign in through jmeter work. But it only worked twice. First with one user in the thread group. And then i used 10 users out of which 3 were successfully logged in. So it means my way of doing it has no problem (since it was successful on 4 occasions). But next time onward, it stopped working. Only suspicious observation I have is all the requests are getting same auth token (p_auth) no matter how many times or how many users i run it with. I even restarted jmeter. Why would it generate the same token consistently for all different requests through jmeter? When i try a browser, it works (comes with different token every time).
How do I get it to working? Any help is appreciated!
Liferay introduces a token (p_auth) for CSRF protection. This token can be used just once, and that's a problem for performance tests.
You should disable that token during the tests execution, but remember to enable it again after the tests.
auth.token.check.enabled=false

Jmeter: To login multiple times and hitting multiple URLS

I am novice in Jmeter, just started to know its inner functionality. I am stuck in a problem. I have to hit multiple urls (only search id) is changed so in "HTTP Request" i have placed "/build-4.4.10.0/?earchId=${ID}&Application=sc&IsSearchLink=TRUE"
I am providing session key and that search id through csv file. Problem is though its going to the link but redirecting it to login page, and i do not know how to create users on run time and assign to that each URL.
I have 200+ URLS, what should i do, please guide
Thanks
If your application needs any login authentication and/or cookies, then you will need to add the Cookie manager for maintaining the session, else application will not be able to maintain a session and it will throw the user out of the application, then redirecting it to the login page.
You can refer to the below mentioned links for more information about cookie manager.
https://sqa.stackexchange.com/questions/13966/jmeter-http-cookie-manager/13975#13975
http://jmeter.apache.org/usermanual/component_reference.html#HTTP_Cookie_Manager

Resources