How to run a changed simulation

I have been following the quickstart of gatling. Now I want to follow the advanced tutorial, and to change the scala file.

So I made a copy of the scala file (named BasicSimulation1.scala) in the directory

user-files/simulations/computerdatabase/

which now contains the following content:

advanced BasicSimulation1.scala BasicSimulation.scala

However, when I run gatling (i.e. . bin/gatling.sh) it does not find the original simulation (named BasicSimulation.scala).

What is going on? How to use a different scala file?

Thanks
Alex

I don’t know for sure, but if you just copy the file and don’t edit the file to rename the class then I think you will get a problem.
You could try opening BasicSimulation1.scala and where it says “class BasicSimulation extends Simulation” change it to “class BasicSimulation1”.
I can imagine that all class names need to be unique. Normal naming rules for Scala classes will presumably apply, e.g. name shouldn’t start with a number or contain special characters.
Thanks,
Dave.

e.g. your scala file(s) will c

See also https://gatling.io/docs/current/general/bundle_structure/

Yes thanks,

I am not familiar with scala, and renaming the class solved the issue.

Thanks a lot.