问题
I need to start a Gatling simulation from a main application. The use case is as follows:
- The application reads a specification, and generate test cases based on this specification.
- The test cases are converted into Gatling scenarios.
- The scenarios are run in a Gatling simulation.
So far I managed to do this via the sbt plugin. However this is inconvenient if we want to reuse the tool I'm developing in other contexts (imagine non-scala projects for instance).
Since I'm generating Gatling scenarios dynamically which means that I cannot simply pass a Scala class to the Gatling binary.
I was able to run the simulation as follows:
Gatling.fromArgs(args, Some(classOf[Simulation]), _ => new ValidationTest)
Where ValidationTest
is the class that generates the scenarios dynamically. However, I'm not sure that is the proper way of using Gatling in a standalone application.
来源:https://stackoverflow.com/questions/38716587/what-is-the-proper-way-of-running-gatling-from-a-stand-alone-application