Passing a separate protocol configuration to each scenario of a multi-scenario simulation

Hello,

Documentation contains an example in which separate protocol configs are passed to each scenario (https://github.com/excilys/gatling/wiki/Advanced-Usage#wiki-multi-scenario). It seems that the API was changed during refactoring(e.g. https://github.com/excilys/gatling/commit/7c081d309d94010ed6dd7f4eb644e6b516a03135). Is there a way to pass a separate protocol config to each scenario in multi-scenario simulation ?

It’s back in master (we had feedback from the community after we did that change in 2M3a).

Cool! Is there a known workaround for 2M3a version ?

Вівторок, 25 лютого 2014 р. 22:00:07 UTC+2 користувач Stéphane Landelle написав:

Nope, sorry.

Was there any changes in custom protocol config API or example from docs should work? For some reason I’m still getting compilation errors when trying to use example from docs with snapshot version of Gatling.

What’s your problem exactly?

I have the following fragment:

setUp(
testScenarios.map(s => s.inject(atOnceUsers(1).protocolConfig(addScnName(scn)))).toList: _*
)

Which results in:

value protocolConfig is not a member of io.gatling.core.controller.inject.AtOnceInjection

Where testScenarios is an iterable with all scenarios and addScnName returns custom protocol config for the specified scenario (actually it just adds custom header with scenario name so all request of each scenario contain header with the corresponding name)

Many things wrong, the first one being that you should close inject() before trying to set up the protocols.
Then the method name is wrong: https://github.com/excilys/gatling/blob/master/gatling-http/src/test/scala/io/gatling/http/HttpCompileTest.scala#L218

Thanks, I just used documentation from https://github.com/excilys/gatling/wiki/Advanced-Usage#multi-scenario . Seems like it’s bit outdated.

It’s for Gatling 1.
We’re currently working on the documentation for Gatling 2M4, such as https://github.com/excilys/gatling/blob/master/src/sphinx/general/simulation_setup.rst#injection