I am newbie to both gatling and scala . I have a list where I am keeping track of setupValues . I want to iterate over that list later to test get Operations . How can I do that.
I basically want feeder to repeat continuously for given data in list.
I tried creating feeder in below way below way . but its throwing exception
val setupDeleteExtensions = List.empty[String]
// I populated some values to setupDeleteExtensions List
val extensionIds = Iterator.continually(for (extensionId<-extmgrChain.setupInstallExtensions) yield {
Map("extensionId" -> extensionId)
})
val extMgrScenerio = scenario("extensionMgr - Scenario")
.during(Configuration.duration) {
exitBlockOnFail(
group("load-test") {
exec(
pace(Configuration.paceFrom, Configuration.paceTo),
feed(extensionIds)
randomSwitch(
50.00 -> group("get and Acknowledge") {
exec(
extmgrChain.getExtension(),
extmgrChain.getAcknowledgement()
)
},
50.00 -> extmgrChain.getResource(),
)
)
}
)
}
exception :
found : Iterator[List[scala.collection.immutable.Map[String,String]]]
required: io.gatling.core.feeder.FeederBuilder
(which expands to) () => Iterator[scala.collection.immutable.Map[String,Any]]
Can some one please help on how to create a feeder from list
When you have
val extensionIds = Iterator.continually(for (extensionId<-extmgrChain.setupInstallExtensions) yield {
Map("extensionId" -> extensionId)
})
each time you .feed and get the next value from the iterator it will run the for loop across your setupInstallExtensions - this will return a List of Maps whereas gatling requires just a Map like
val extensionIds = extmgrChain.setupInstallExtensions.map(id => Map("extensionId" -> id)).iterator