Hi All,
I have a script like the following one…
- import scala.concurrent.duration._
- import io.gatling.core.Predef._
- import io.gatling.http.Predef._
- class logingood extends Simulation {
- val httpConf = http.baseUrl(“http://newtours.demoaut.com”)
- val scn1 = scenario(“Scenario 1”).during(10 minutes)
- {
- exec(http(“basicgetrequest”).get("/mercurycruise.php"))
- }
- val scn2 = scenario(“Scenario 1”).during(10 minutes)
- {
- pause(3 minutes)
- .exec(http(“basicgetrequest2”).get("/mercurycruise.php"))
- }
- setUp(scn1.inject(atOnceUsers(1)),
- scn2.inject(nothingFor(3 minutes),atOnceUsers(1))).protocols(httpConf);
- }
is it possible to write the scenario as val scn1 = scenario(“Scenario 1”).during(x minutes)…and I can call scn1 in different classes and pass different x values (all the different classes are called together). For eg: in one class when I need to call scn1, there I need to pass x as 10 minutes and in another scenario when scn1 need to be called, there x will be 20. This way it will not require to write the entire script multiple times. Just call the scenario and pass the different x values as required.
Regards,
Prasenjit