# Parallel scenarios or I am missing something?

**URL:** <https://community.gatling.io/t/parallel-scenarios-or-i-am-missing-something/4188>\
**Category:** Gatling (Open-Source)\
**Created:** [February 20, 2018, 9:08am UTC](https://community.gatling.io/t/parallel-scenarios-or-i-am-missing-something/4188 "2018-02-20T09:08:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Craz1Cadr1ca](https://avatars.discourse-cdn.com/v4/letter/c/ce73a5/32.png) [@Craz1Cadr1ca](https://community.gatling.io/u/Craz1Cadr1ca)\
**Post date:** [February 20, 2018, 9:08am UTC](https://community.gatling.io/t/parallel-scenarios-or-i-am-missing-something/4188/1 "2018-02-20T09:08:42Z")

</div>

Hi guys,

I am new to gatling and we just started using it in our company. So far so good, it is amazing , however, now I would like to make more complex scenario where I do certain action (in this case request) to endpoint for multiple users in parallel (our users not gatling users/workers).  
So can anyone tell me how can I achieve such behavior? I was thinking of that I need to run the same scenario with different parameters in parallel, but then I saw [https://gatling.io/docs/current/http/http\_protocol/#http-client-sharing](https://gatling.io/docs/current/http/http_protocol/#http-client-sharing) and now I am confused will that work?

`

package sandbox

import tokens.Tokens

import scala.io.Source  
import scala.concurrent.duration.\_

import io.gatling.core.Predef.\_  
import io.gatling.http.Predef.\_  
import io.gatling.jdbc.Predef.\_

class CalculateBetslip extends Simulation {

val users = new Tokens  
val maxUsers = Integer.getInteger(“users”, 1)

val placeBets = http  
.baseURL(“host here”)  
.inferHtmlResources()  
.headers(  
Map(  
“Accept” → “_/_”,  
“Authorization” → users.tokens(0), // ← I want this to be dynamic for each GATLING user/worker  
“ContentType” → “application/json”  
)  
)

val headers\_0 = Map(  
“accept-encoding” → “gzip, deflate”,  
“cache-control” → “no-cache”,  
“content-length” → “291”)

val placeBetsScenario = scenario(“placeBets”)  
.exec(http(“request\_0”)  
.post("/betting/placeBets")

setUp(placeBetsScenario.inject(atOnceUsers(1)).protocols(placeBets)) // Our api holds state, which means that here , when I supply (lets say atOnceUsers(100)) I want to use 100 different tokens but I don’t know how  
}

`

---

<div class="post-metadata">

**Author:** ![khaled.alrimawi7](https://avatars.discourse-cdn.com/v4/letter/k/7c8e57/32.png) [@khaled.alrimawi7](https://community.gatling.io/u/khaled.alrimawi7)\
**Post date:** [February 21, 2018, 2:03pm UTC](https://community.gatling.io/t/parallel-scenarios-or-i-am-missing-something/4188/2 "2018-02-21T14:03:07Z")

</div>

Hi

I don’t know if i get your question or not, but what i understand that you want to run the same scenario with different parameters in parallel.

First of all, you can use “setUp(placeBetsScenario.inject(rampUsers(10) over (20 second) ))” to run multi users(10 in the ex) in parallel.

Then, for different parameter it’s depend on how you want to send. It can be by generating random number(Random.nextInt(MaxValue)) or by using csv feeder where u can read from it randomly or sequentially

Please let me know if that clarification helped you

---

<div class="post-metadata">

**Author:** ![Craz1Cadr1ca](https://avatars.discourse-cdn.com/v4/letter/c/ce73a5/32.png) [@Craz1Cadr1ca](https://community.gatling.io/u/Craz1Cadr1ca)\
**Post date:** [February 22, 2018, 1:05pm UTC](https://community.gatling.io/t/parallel-scenarios-or-i-am-missing-something/4188/3 "2018-02-22T13:05:59Z")

</div>

Hi, no I meant real users (our customers) not virtual users of gatling, but I read about feeders and I think I solved this, but do you know by any chance if we are able to configure json feeder to start from some index?
