dynamic feeder from previous executions


I am trying to build my scenario with values based on previous execution.


val allTests = scenario("Prepare").exec(GetAuthenticationToken.getAuthenticationToken).exec(CreateCompany.createCompany).exec(CreateEmployee.createEmployees)

createCompany will generate a companyId which I can either save as a global attribute or in the session.  Same for CreateEmployees which will save all employees id created in a list.

So once this scenario is done, I have indeed created a companyId and multiple employeesId.

Now, I want to add a final step which is to load test the retrieval of these employeesId.  I am trying to use a feeder but it seems impossible to feed dynamically generated date in a feeder.

Every time I try, if I access the values from a global variable, I get empty values, if I try to access it from the session, I get "No attribute named 'createdCompanyId' is defined".

So I understand that my code is being evaluated before execution.

I have tried many ways but at this point, I just wonder if what I am trying to do is possible.  Has anyone tried this ?  If now, can someone suggest me an alternative way to code my stuff.

Thank you.

Impossible to tell without you sharing your code for your custom feeder.

Hello Stéphane.

I can share my code but first, is what I am trying to do even feasible ?

My input for the GetXYZ at the end would be if it were a CSV file :





I am able to play with session, it is when I try to build my map dynamically that it all appears empty.

Thank you.

Feeder is an alias for Iterator[Map[String, Any]] so it doesn’t have to be file based.
In particular, our file based implementations eagerly read the data on startup.
You probably want to build an in-memory implementation.