How to login to liferay website using JMeter

152 Views Asked by At

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))

1

There are 1 best solutions below

0
Dmitri T On

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.