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


which now contains the following content:

advanced BasicSimulation1.scala BasicSimulation.scala

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

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


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.

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

See also

Yes thanks,

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

Thanks a lot.