Login page is returned always even though sessions are handled - jmeter

JMeter version 5.x and 4.0
Protocol : Https
Steps
Start creating a test plan with a recording template
Configure the HTTP(S) Test Script Recorder with HTTPS domain, target controller
Save the test plan and start the proxy server
Configure Firefox with security certificate and proxy details
Access the login page https://www.systemname.com . Request is recorded
Login to the system with valid credentials. Request is recorded successfully
Add a Boundary value Extractor post processor to extract session variable (LCSRF_VAL) and replace the session value recorded in the login request with ${LCSRF_VAL}
Save the test plan and run the test
Check the responses in View Result Tree --> HTML view
Actual Outcome
User is not logged into the system. Login page is returned.
Expected Outcome
User should be able to login when sessions are handled
Note :
It worked fine if recording started from a URL of a page inside the system. For example
https://www.system.com/en/administration/Search?nav=Administration

Related

How to login to liferay website using JMeter

I am facing one problem that i am unable to login to the liferay website using JMeter.
The problem i know already but don't know how to hanmdle it.
I get to know that "p_auth" token is requried to access the sub pages, but here i am facing an issue in which i don't even able to acccess the login page itself if run the script second time.
My concerns:
how to check "p_auth" token parameter for login page (i.e without login)
Please help me to solve the problem.
Note: i tried to extract the "p_auth" token , but i am unable to see any "p_auth" token for login page itself(i.e without login.. just a login page(get api))
Your test plan need to look like:
Open Login Page - HTTP GET request
Extract p_auth dynamic parameter value using a suitable JMeter Post-Processor
Perform the login - HTTP POST request where you need to provide your credentials and the p_auth token value from the previous request
You won't be able to "see" the token in the page, it's hidden in the page source so you will need to use browser developer tools or JMeter's View Results Tree listener in order to "see" the token value.
Also don't forget to add HTTP Cookie Manager to your test plan as missing CSRF token is not the only thing which can stop you from logging in.

Redirect Jmeter to the home page after successful login with multiple users

I created a script multiple user logins and redirected to the home page. For multiple user logins fetching data from CSV file but after logged in, home page redirection is not working.
There are multiple possible explanations:
Your login fails somewhere somehow so you're still at the login page, check the server response using View Results Tree listener and if this is the case - fix your script. It might be sufficient to add a HTTP Cookie Manager to represent user session
You might need to play with Redirect automatically / Follow redirects checkboxes on HTTP Request sampler level
Your redirect is being managed by JavaScript and JMeter is not capable of executing JavaScript so you need to extract the desired redirect location using a suitable JMeter Post-Processor (basically implement correlation of the redirect URL) and add another HTTP Request sampler to open the redirect target.
More information: Redirections in HTTP
In general make sure that JMeter sends the same requests as the real browser does, given this simple rule is met you should be able to properly simulate real user actions

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.

Recorded user authentication then run same script with another user id and password but Jmeter displaying previous user's dashboard

Recorded user authentication for one user then run script in Jmeter and successfully logged-in. Now change user id and password for another user but displaying previous user information not changed user information
Check out if there are any headers being sent via HTTP Header Manager. It might be the case your application under test identifies user via header
Check if recorded URLs contain dynamic postfix which can act as user session identifier
If there is a HTTP Authorization Manager in your Test Plan - update username and password there
Consider adding HTTP Cookie Manager to our Test Plan - it should be sufficient to automatically handle user sessions
Generic troubleshooting step: capture the requests sent by JMeter and the real browser using a sniffer tool like Wireshark or Fiddler and compare them. Amend JMeter configuration to eliminate differences.

Unable to login using jmeter?

I have recorded login script using jmeter and when I run it the user is not logged in. There is no session parameter to pass.
Below is application which used for my study.
www.gandermountain.com
Looking into the network dump
I believe all you need to do in order to mimic the login is just to add HTTP Cookie Manager to your Test Plan
What error you are getting while running your script? If you are not able to logon, add the cookie manager (Test Plan -> Add -> Config Element -> HTTP Cookie Manager) under your test plan.
If it doesnt work, check any other parameter values getting changed in your home page and login requests. If yes, parameterize that too and then try. It will work

Resources