0

In My application the login page is very slow such that when I perform load test its breaks even before going to the main page. For that with few login credentials and by iterating them I need to generate new cookie everytime and store all of them in .csv file so that in near future I can just use cookie to login and load test won't break.

Request Body has Cookie Data: cb=k3fp7s1rnjoil48ep8aeilro64; lang=en_US

Meghana
  • 3
  • 3
  • If you add an example of what the Requests Body in the View Results Tree in JMeter looks like then we might be able to point you to a solution. – P Moran Mar 12 '20 at 19:38
  • My request body has "Cookie Data: cb=k3fp7s1rnjoil48ep8aeilro64; lang=en_US " – Meghana Mar 12 '20 at 20:46
  • Meghana Refer this link https://stackoverflow.com/questions/60635179/how-to-extract-and-store-a-value-from-jmeter-response-and-store-inn-csv – Chandra Sekhar Y Mar 13 '20 at 04:12

1 Answers1

0
  1. Add the next lines to user.properties file (lives in "bin" folder of your JMeter installation)

    CookieManager.save.cookies=true
    sample_variables=COOKIE_cb
    
  2. Restart JMeter to pick up the changes
  3. Add HTTP Cookie Manager to your Test Plan
  4. Add Flexible File Writer to your Test Plan and configure it like:

    enter image description here

  5. That's it, when you run your test next time you will see a new file called values.csv holding the cookies for each thread (virtual user), each cookie on the new line.
Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • I have tried the above steps but it didn't work for me. Should I add Regular Expression Extractor in Test Plan? – Meghana Mar 23 '20 at 02:42