Modularising /chaining scenarios

Hi

I have tried to implement a process running scenarios in sequence using the method described in :https://stackoverflow.com/questions/15568284/modularising-scenarios-to-run-in-sequence-using-gatling

We have a number of scenarios that will be running in parallel, but there are a few that will need to be run in sequence, i.e scn1, then scn2 then scn3

ive tried this

package CommPayPerfTest

import CommPayPerfTest.Configuration._
import CommPayPerfTest.Components.Common._
import CommPayPerfTest.Scenarios._
import CommPayPerfTest.Scenarios.CommPay.PerfTestApi._
import io.gatling.core.structure.{ChainBuilder, ScenarioBuilder}

import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._

// Use this for developing a scenario in isolation
class StatementSimulation extends Simulation {

val httpProtocol = Config.getHttpProtocol(http)

val statementRecords = exec(StatementRecord)
val statementImport = exec(StatementImport)

val modular = Seq (statementRecords,statementImport)

val scn1 = scenario (“Scenario 1”).exec(modular)

setUp(

scn1.getScenario()
.inject(atOnceUsers(1))

//scn1.getScenario()
// .inject(atOnceUsers(1))
)

.protocols(httpProtocol)

}

but it fails with this error:

12:13:14.968 [ERROR] i.g.c.ZincCompiler$ - C:\Gatling\Commpay-PerformanceTesting\user-files\simulations\CommPayPerfTest\Scenarios\CommPay\PerfTestApi\StatementScenarios.scala:20:28: overloaded method value exec with alternatives:
(scenario: io.gatling.core.structure.ScenarioBuilder)io.gatling.core.structure.ChainBuilder
(chains: Iterable[io.gatling.core.structure.ChainBuilder])io.gatling.core.structure.ChainBuilder
(chains: Iterator[io.gatling.core.structure.ChainBuilder])io.gatling.core.structure.ChainBuilder
(chains: io.gatling.core.structure.ChainBuilder*)io.gatling.core.structure.ChainBuilder
(actionBuilder: io.gatling.core.action.builder.ActionBuilder)io.gatling.core.structure.ChainBuilder
(sessionFunction: io.gatling.core.session.Expression[io.gatling.core.session.Session])io.gatling.core.structure.ChainBuilder
cannot be applied to (CommPayPerfTest.Scenarios.CommPay.PerfTestApi.StatementRecord.type)
val statementRecords = exec(StatementRecord)

any ideas i thought this would be straightforward…)
^

iress.com

Shazad Dad​

Senior Tester

Tel: +441926621417

shazad.dad@iress.com

www.iress.com

1 Kingmaker Court, Warwick Technology Park, Gallows Hill,
Warwick, Warwickshire, CV34 6DY

The contents of this email originated from Iress. For this purpose Iress includes Iress Limited and/or any of its subsidiaries, holding companies and trading entities.
​If you have received this email in error please notify the sender immediately and delete this email.

nosig

Hi,

It says “cannot be applied to (CommPayPerfTest.Scenarios.CommPay.PerfTestApi.StatementRecord.type)”. Hence, I suspect StatementRecord and StatementImport are actually objects while they should be vals of defs with a chain inside.

thank you for your response,
i changed the simulation so it calls the object and then then defs like

val statementRecords = exec(StatementRecord.createStatementRecord)
val statementImport = exec(StatementImport.importStatements)

val modular = Seq (statementRecords,statementImport)

val scn1 = scenario (“Scenario 1”).exec(modular)

setUp(

scn1.inject(
atOnceUsers(1))

//scn1.getScenario()
// .inject(atOnceUsers(1))
)

.protocols(httpProtocol)

it compiles which is better news, but it only runs the second scenario ‘Statement Import’ - not the first one statementrecords.?

Shazad Dad​

Senior Tester

Tel: +441926621417

The contents of this email originated from Iress. For this purpose Iress includes Iress Limited and/or any of its subsidiaries, holding companies and trading entities.
​​If you have received this email in error please notify the sender immediately and delete this email.

Thats now working thanks

Shazad Dad​

Senior Tester

Tel: +441926621417

The contents of this email originated from Iress. For this purpose Iress includes Iress Limited and/or any of its subsidiaries, holding companies and trading entities.
​​If you have received this email in error please notify the sender immediately and delete this email.

just an additional question related to this, when creating a sequence of scenarios can i still use the individual scenario set in the simulation or would it need to use a single generic feeder file?

Shazad Dad​

Senior Tester

Tel: +441926621417

The contents of this email originated from Iress. For this purpose Iress includes Iress Limited and/or any of its subsidiaries, holding companies and trading entities.
​​If you have received this email in error please notify the sender immediately and delete this email.