Custom feeder and multiple scenaro

Hi all,

I’m using gatling to create a scenario with 4 http exec and a custom feeder to generate fake UDDID.

object FeederApi {
val emeiFeeder = new Feeder[String] {

override def hasNext = true

override def next: Map[String, String] = {
Map(“emei” → scala.math.abs(java.util.UUID.randomUUID.getMostSignificantBits).toString())
}
}
}

val scnMobile = scenario(“load Test”)
.feed(Array(FeederApi.emeiFeeder.next).circular)
.exec(
http(“request_1”)
.get(“http://url1”)
.queryParam(“emei”, “${emei}”)
.headers(headers_1)
.check(status.is(200)))
.pause(0 milliseconds, 0 milliseconds)
.exec(
http(“request_2”)
.get("/url2.php")
.queryParam(“emei”, “${emei}”)
.headers(headers_1)
.check(status.is(200)))
.pause(0 milliseconds, 0 milliseconds)
.exec(
http(“request_3”)
.get("/url3.php")
.queryParam(“emei”, “${emei}”)
.headers(headers_1)
.check(status.is(302)))
.pause(1000 milliseconds, 3000 milliseconds)
.exec(
http(“request_4”)
.get("/url4.php")
.queryParam(“emei”, “${emei}”)
.headers(headers_1)
.check(status.is(302)))

setUp(
scnMobile.users(3).ramp(0).protocolConfig(httpConf_1)
)

My problem come from the url is build with the same emei parameter for the 3 users instead to have 3 urls with 3 differents emei parameter for the 3 users.

I think i’ve made a mistake but i don’t know where.

If somebody could help me to resole my problem it will be great.

Thanks a lot.

Mickaël.

Hi,

feed() take a feeder once and for all.

You’re converting your FeederApi.emeiFeeder into a new circular Feeder that has only one value (the one coming from the only time FeederApi.emeiFeeder.next is called).

You just have to pass your original feeder:

feed(FeederApi.emeiFeeder)

Cheers,

Stéphane

Stephane,

Thanks a lot it’s working.

I need to read again the documentation :wink:

Mickaël.