How to save and reuse randomly generated data‏

I have 2 scenarios I am writing at the moment using Gatling. 1. Register users, 2. Log in users

Scenario 1 has been created fine however I am struggling with scenario 2. I would like to somehow save and reuse the randomly generated email address I have created for register user for the login user. But as the email is randomly generated even if I use the same object for the log in scenario it wouldn’t work. Is there some way I could inject randomly generated data from one simulation into e.g. a CSV file, and reuse it using a feeder for another simulation.

Thanks

Hi Zhu Hui Wang
You can create your own CSV file by yourself and provide your own email addresses (lets say gatlingUser1@gatling.com)
In second simulation just run over this csv file.

Thank you Greg!

Would the load test results differ as I will be re-using the same account details i.e. requesting multiple http requests for the same account ? Not sure if this kind of information gets cached .

Also the reason why i wanted to re-use the registered account for the log in test is because I need a way to generate the log in data therefore I need accounts to be registered first. Else I would have to manually register users and that could change depends on the thread.

It is OK.
This does not contradict what I said.

If you create csv file with username,password values, run login process and then gatling caches security token for all other requests that you chain after login.

Thanks Greg. What about my second question regarding generating the log in data in the first place?

Hey Greg,

How are you? I was wondering if you have any insight in to how the user login test data can be generated in the first place in order to run login load tests?

Thanks

Hello Zhu Hui Wang,

Do you wish to run this scenarios in one simulation? You can save all the information in a session object and access it later.

If these are seperate scenarios or you want to save the info then search for extrainfoextractor. You can use the log files currently generated by gatling in logback.xml. If you search this forum you should be able to find out both of them.