# How to loop simulations? (Feature request?)

**URL:** <https://community.gatling.io/t/how-to-loop-simulations-feature-request/3617>\
**Category:** Gatling (Open-Source)\
**Created:** [March 17, 2017, 3:08pm UTC](https://community.gatling.io/t/how-to-loop-simulations-feature-request/3617 "2017-03-17T15:08:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juan\_Manuel\_Flaherty](https://avatars.discourse-cdn.com/v4/letter/j/6de8d8/32.png) [@Juan\_Manuel\_Flaherty](https://community.gatling.io/u/Juan_Manuel_Flaherty)\
**Post date:** [March 17, 2017, 3:08pm UTC](https://community.gatling.io/t/how-to-loop-simulations-feature-request/3617/1 "2017-03-17T15:08:57Z")

</div>

Hi,

I want to repeat a simulation over and over, but Gatling is missing a method for doing so. Is there a way of doing this? Or could it be implemented for a new version?

What I have is this:

`

```auto
class LoginEpTest extends Simulation {
  setUp(LoginEpScenarios.loginScenario.inject(
      rampUsers(100).over(10 seconds),
      nothingFor(2 minutes)
  ).protocols(Http.httpProtocol)
}

```

`

I want to reiterate this several times.

I know there is a repeat() method for scenarios, but that would make a same user to repeat the same actions over again. What I want is to have different users doing this simulation over and over until it satisfies the conditions I’ve established for the loop.  
I would like to do something like the following:

`

```auto
class LoginEpTest extends Simulation {
  setUp(LoginEpScenarios.loginScenario.inject(
    repeat(7, counterName) {
      rampUsers(100).over(10 seconds),
      nothingFor(2 minutes)
    }
  ).protocols(Http.httpProtocol)
}

```

`

I rather don’t copy&paste the same injections several times.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [January 24, 2018, 6:42am UTC](https://community.gatling.io/t/how-to-loop-simulations-feature-request/3617/2 "2018-01-24T06:42:09Z")

</div>

Read this issue for closed workload model support: [https://github.com/gatling/gatling/issues/1647](https://github.com/gatling/gatling/issues/1647)

Then, the “until it satisfies the conditions I’ve established for the loop” is probably not something we’ll have in Gatling OSS but in FrontLine someday.

---

<div class="post-metadata">

**Author:** ![Juan\_Manuel\_Flaherty](https://avatars.discourse-cdn.com/v4/letter/j/6de8d8/32.png) [@Juan\_Manuel\_Flaherty](https://community.gatling.io/u/Juan_Manuel_Flaherty)\
**Post date:** [January 24, 2018, 10:58am UTC](https://community.gatling.io/t/how-to-loop-simulations-feature-request/3617/3 "2018-01-24T10:58:14Z")

</div>

Got it! Thanks again, Stéphane!

Just one more question:
