0

I am new to JMeter. I tried to record login or sign-up using the JMeter proxy in Magento 2.2.7 and I tried to view the result in the JMeter, but in JMeter. I'm unable to get the response of the login page success. Please find the screenshot:

enter image description here

2
  • Does this answer your question? How to login a page using JMeter?
    – PDHide
    Dec 14, 2019 at 9:39
  • No.I already followed the steps and when seeing the view result JMeter, it will not showing the response page.Its again showing the login page in the response(please refer the screenshot above).
    – Arul
    Dec 14, 2019 at 10:22

1 Answer 1

2

In the absolute majority of cases you will not be able to successfully replay script recorded by HTTP(S) Test Script Recorder without performing correlation

Modern web applications widely use dynamic parameters for client-side state tracking or security reasons, in case of Magento most probably your login fails due to form_key parameter incorrect value.

Also don't forget about Cookies

The steps would be:

  1. Add HTTP Cookie Manager to your Test Plan
  2. Add HTTP Request sampler to open login page, i.e. make a GET request to /customer/account/login/

    enter image description here

  3. Add a suitable JMeter's Post-Processor to extract the aforementioned form_key field value, I would recommend going for CSS Selector Extractor

    enter image description here

  4. Add another HTTP Request sampler which will perform the actual login, i.e. making a POST request to /customer/account/loginPost Make sure to replace recorded hard-coded value of the form_key parameter with the reference to JMeter Variable from step 3

    enter image description here

  5. That's it, you should be logged in now:

    enter image description here

5
  • now I am trying for signup but it redirects to the login page. Is there are any changes I need to do for signup using JMeter?
    – Arul
    Jan 6, 2020 at 13:04
  • 1
    The overall process should be similar, just pay attention to the correlation of the dynamic parameters. I cannot provide comprehensive answer due to the limitation of the comment field, if you will be still experiencing problems - consider asking a new question
    – Dmitri T
    Jan 6, 2020 at 13:10
  • I posted as a separate question sqa.stackexchange.com/questions/42049/….
    – Arul
    Jan 6, 2020 at 15:12
  • I'm not your personal JMeter consultant
    – Dmitri T
    Jan 6, 2020 at 15:42
  • sorry, from your previous comment only I shared a link. Your previous answers are very helpful, thank you.
    – Arul
    Jan 6, 2020 at 16:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.