Search code examples
parallel-processingscala-gatling

Parallel Test using Gatling


I have a scala file customized for one the flow, let us say from login, verification screen and home screen. I have many other workflows such as

1.login, verification screen, home and change address. 2.login, verification screen, home and change credit limit 3.login, verification screen, home and lost/stolen.

Below are my questions. Should I include the scala code for all the above workflows in one single scala file and call these as scenarios using setUp? or can the above flows be in separate scala files?

My End goal is to execute all the above flows in parallel, so that we can measure the load that the application can handle. Any examples/code is appreciated.


Solution

  • You can split in many Scala files as you want, and then import into one single Simulation, eg:

    object Scenario1 {
     val scenario = ???
    }
    object Scenario2 {
     val scenario = ???
    }
    class MySimulation extends Simulation {
     setUp(
       Scenario1.scenario.inject(???),
       Scenario2.scenario.inject(???),
     )
    }
    

    You should go through the official tutorials or the Gatling Academy, this is clearly demonstrated there.